Package com.norconex.committer.sql
Class SqlCommitterConfig
java.lang.Object
com.norconex.committer.core.BaseCommitterConfig
com.norconex.committer.core.batch.BaseBatchCommitterConfig
com.norconex.committer.sql.SqlCommitterConfig
- All Implemented Interfaces:
Serializable
SQL Committer configuration.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanJDBC connection URL.The ALTER statement used to create missing table fields.The CREATE statement used to create a table if it does not already exist.Class name of the JDBC driver to use.Path to JDBC driver.One or more characters to join multi-value fields.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.The target database table name where documents will be committed.Table field name where to store the document content stream.inthashCode()booleanWhether to attempt preventing insertion errors by converting characters that are not underscores or alphanumeric to underscores.booleanAttempts to prevent insertion errors by truncating values that are larger than their defined maximum field length.setConnectionUrl(String connectionUrl) JDBC connection URL.setCreateFieldSQL(String createFieldSQL) The ALTER statement used to create missing table fields.setCreateTableSQL(String createTableSQL) The CREATE statement used to create a table if it does not already exist.setCredentials(Credentials credentials) setDriverClass(String driverClass) Class name of the JDBC driver to use.setDriverPath(String driverPath) Path to JDBC driver.setFixFieldNames(boolean fixFieldNames) Whether to attempt preventing insertion errors by converting characters that are not underscores or alphanumeric to underscores.setFixFieldValues(boolean fixFieldValues) Attempts to prevent insertion errors by truncating values that are larger than their defined maximum field length.setMultiValuesJoiner(String multiValuesJoiner) One or more characters to join multi-value fields.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.setProperties(Properties properties) setTableName(String tableName) The target database table name where documents will be committed.setTargetContentField(String targetContentField) Table field name where to store the document content stream.toString()Methods inherited from class com.norconex.committer.core.batch.BaseBatchCommitterConfig
getQueue, setQueueMethods inherited from class com.norconex.committer.core.BaseCommitterConfig
addRestriction, addRestrictions, clearFieldMappings, clearRestrictions, getFieldMappings, getRestrictions, removeFieldMapping, removeRestriction, removeRestriction, setFieldMapping, setFieldMappings
-
Field Details
-
DEFAULT_SQL_CONTENT_FIELD
Default SQL content field- See Also:
-
DEFAULT_MULTI_VALUES_JOINER
Default multi-value join string- See Also:
-
-
Constructor Details
-
SqlCommitterConfig
public SqlCommitterConfig()
-
-
Method Details
-
getCredentials
-
setCredentials
-
getProperties
-
setProperties
-
getDriverPath
Path to JDBC driver. Not required if already in classpath. -
getDriverClass
Class name of the JDBC driver to use. -
getConnectionUrl
JDBC connection URL. -
getTableName
The target database table name where documents will be committed. -
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
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
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
One or more characters to join multi-value fields. Default is "|". -
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
Path to JDBC driver. Not required if already in classpath.- Returns:
this.
-
setDriverClass
Class name of the JDBC driver to use.- Returns:
this.
-
setConnectionUrl
JDBC connection URL.- Returns:
this.
-
setTableName
The target database table name where documents will be committed.- Returns:
this.
-
setPrimaryKey
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
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
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
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
Attempts to prevent insertion errors by truncating values that are larger than their defined maximum field length.- Returns:
this.
-
setMultiValuesJoiner
One or more characters to join multi-value fields. Default is "|".- Returns:
this.
-
setTargetContentField
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
- Overrides:
equalsin classBaseBatchCommitterConfig
-
canEqual
- Overrides:
canEqualin classBaseBatchCommitterConfig
-
hashCode
public int hashCode()- Overrides:
hashCodein classBaseBatchCommitterConfig
-
toString
- Overrides:
toStringin classBaseBatchCommitterConfig
-