Class SqlCommitterConfig

All Implemented Interfaces:
Serializable

public class SqlCommitterConfig extends BaseBatchCommitterConfig implements Serializable

SQL Committer configuration.

See Also:
  • Field Details

    • DEFAULT_SQL_CONTENT_FIELD

      public static final String DEFAULT_SQL_CONTENT_FIELD
      Default SQL content field
      See Also:
    • DEFAULT_MULTI_VALUES_JOINER

      public static final String DEFAULT_MULTI_VALUES_JOINER
      Default multi-value join string
      See Also:
  • Constructor Details

    • SqlCommitterConfig

      public SqlCommitterConfig()
  • Method Details

    • getCredentials

      public Credentials getCredentials()
    • setCredentials

      public SqlCommitterConfig setCredentials(Credentials credentials)
    • getProperties

      public Properties getProperties()
    • setProperties

      public SqlCommitterConfig setProperties(Properties properties)
    • getDriverPath

      public String getDriverPath()
      Path to JDBC driver. Not required if already in classpath.
    • getDriverClass

      public String getDriverClass()
      Class name of the JDBC driver to use.
    • getConnectionUrl

      public String getConnectionUrl()
      JDBC connection URL.
    • getTableName

      public String getTableName()
      The target database table name where documents will be committed.
    • getPrimaryKey

      public String getPrimaryKey()
      The name of the table primary key field where the document reference will be stored, unless it is already set by a field of the same name in the source document. At a minimum, this "primaryKey" field name should be "unique", ideally indexed.
    • getCreateTableSQL

      public String getCreateTableSQL()
      The CREATE statement used to create a table if it does not already exist. If you need fields of specific data types, specify them here. You can use the variable placeholders {tableName} and {primaryKey} which will be replaced with the configuration option of the same name. If you do not use those variables, make sure you use the same names.
    • getCreateFieldSQL

      public String getCreateFieldSQL()
      The ALTER statement used to create missing table fields. The {tableName} variable will be replaced with the configuration option of the same name. The {fieldName} variable will be replaced by newly encountered field names.
    • isFixFieldNames

      public boolean isFixFieldNames()
      Whether to attempt preventing insertion errors by converting characters that are not underscores or alphanumeric to underscores. Will also remove all non-alphabetic characters that prefixes a field name.
    • isFixFieldValues

      public boolean isFixFieldValues()
      Attempts to prevent insertion errors by truncating values that are larger than their defined maximum field length.
    • getMultiValuesJoiner

      public String getMultiValuesJoiner()
      One or more characters to join multi-value fields. Default is "|".
    • getTargetContentField

      public String getTargetContentField()
      Table field name where to store the document content stream. Make it empty or a self-closed tag if you do not want to store the document content. Since document content can sometimes be quite large, a CLOB field is usually advised. If there is already a document field with the same name, that document field takes precedence and the content stream is ignored. Default is "content".
    • setDriverPath

      public SqlCommitterConfig setDriverPath(String driverPath)
      Path to JDBC driver. Not required if already in classpath.
      Returns:
      this.
    • setDriverClass

      public SqlCommitterConfig setDriverClass(String driverClass)
      Class name of the JDBC driver to use.
      Returns:
      this.
    • setConnectionUrl

      public SqlCommitterConfig setConnectionUrl(String connectionUrl)
      JDBC connection URL.
      Returns:
      this.
    • setTableName

      public SqlCommitterConfig setTableName(String tableName)
      The target database table name where documents will be committed.
      Returns:
      this.
    • setPrimaryKey

      public SqlCommitterConfig setPrimaryKey(String primaryKey)
      The name of the table primary key field where the document reference will be stored, unless it is already set by a field of the same name in the source document. At a minimum, this "primaryKey" field name should be "unique", ideally indexed.
      Returns:
      this.
    • setCreateTableSQL

      public SqlCommitterConfig setCreateTableSQL(String createTableSQL)
      The CREATE statement used to create a table if it does not already exist. If you need fields of specific data types, specify them here. You can use the variable placeholders {tableName} and {primaryKey} which will be replaced with the configuration option of the same name. If you do not use those variables, make sure you use the same names.
      Returns:
      this.
    • setCreateFieldSQL

      public SqlCommitterConfig setCreateFieldSQL(String createFieldSQL)
      The ALTER statement used to create missing table fields. The {tableName} variable will be replaced with the configuration option of the same name. The {fieldName} variable will be replaced by newly encountered field names.
      Returns:
      this.
    • setFixFieldNames

      public SqlCommitterConfig setFixFieldNames(boolean fixFieldNames)
      Whether to attempt preventing insertion errors by converting characters that are not underscores or alphanumeric to underscores. Will also remove all non-alphabetic characters that prefixes a field name.
      Returns:
      this.
    • setFixFieldValues

      public SqlCommitterConfig setFixFieldValues(boolean fixFieldValues)
      Attempts to prevent insertion errors by truncating values that are larger than their defined maximum field length.
      Returns:
      this.
    • setMultiValuesJoiner

      public SqlCommitterConfig setMultiValuesJoiner(String multiValuesJoiner)
      One or more characters to join multi-value fields. Default is "|".
      Returns:
      this.
    • setTargetContentField

      public SqlCommitterConfig setTargetContentField(String targetContentField)
      Table field name where to store the document content stream. Make it empty or a self-closed tag if you do not want to store the document content. Since document content can sometimes be quite large, a CLOB field is usually advised. If there is already a document field with the same name, that document field takes precedence and the content stream is ignored. Default is "content".
      Returns:
      this.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class BaseBatchCommitterConfig
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class BaseBatchCommitterConfig
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class BaseBatchCommitterConfig
    • toString

      public String toString()
      Overrides:
      toString in class BaseBatchCommitterConfig