Package com.norconex.committer.sql
Class SQLCommitterConfig
java.lang.Object
com.norconex.committer.sql.SQLCommitterConfig
- All Implemented Interfaces:
Serializable
SQL Committer configuration.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the JDBC connection URL.Gets the SQL statement used to add a new column when a document field has no matching column.Gets the SQL statement used to create the target table when it does not exist.Gets the database authentication credentials.Gets the fully-qualified JDBC driver class name.Gets the path to the JDBC driver JAR file.Gets the separator used to join multi-valued fields into a single string.Gets the primary key column name.Gets additional JDBC connection properties.Gets the target table name.Gets the SQL column name where the document content is stored.inthashCode()booleanGets whether to sanitize field names to conform to SQL identifier rules.booleanGets whether to truncate field values that exceed the column length.voidsetConnectionUrl(String connectionUrl) Sets the JDBC connection URL.voidsetCreateFieldSQL(String createFieldSQL) Sets the SQL statement used to add a new column when a document field has no matching column.voidsetCreateTableSQL(String createTableSQL) Sets the SQL statement used to create the target table when it does not exist.voidsetCredentials(Credentials credentials) Sets the database authentication credentials.voidsetDriverClass(String driverClass) Sets the fully-qualified JDBC driver class name.voidsetDriverPath(String driverPath) Sets the path to the JDBC driver JAR file.voidsetFixFieldNames(boolean fixFieldNames) Sets whether to sanitize field names to conform to SQL identifier rules.voidsetFixFieldValues(boolean fixFieldValues) Sets whether to truncate field values that exceed the column length.voidsetMultiValuesJoiner(String multiValuesJoiner) Sets the separator used to join multi-valued fields into a single string.voidsetPrimaryKey(String primaryKey) Sets the primary key column name.voidsetProperties(Properties properties) Sets additional JDBC connection properties.voidsetTableName(String tableName) Sets the target table name.voidsetTargetContentField(String targetContentField) Sets the SQL column name where the document content is stored.toString()
-
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
-
getDriverPath
Gets the path to the JDBC driver JAR file.- Returns:
- driver JAR path
-
setDriverPath
Sets the path to the JDBC driver JAR file.- Parameters:
driverPath- driver JAR path
-
getDriverClass
Gets the fully-qualified JDBC driver class name.- Returns:
- JDBC driver class name
-
setDriverClass
Sets the fully-qualified JDBC driver class name.- Parameters:
driverClass- JDBC driver class name
-
getConnectionUrl
Gets the JDBC connection URL.- Returns:
- JDBC connection URL
-
setConnectionUrl
Sets the JDBC connection URL.- Parameters:
connectionUrl- JDBC connection URL
-
getCredentials
Gets the database authentication credentials.- Returns:
- credentials
-
setCredentials
Sets the database authentication credentials.- Parameters:
credentials- the credentials
-
getProperties
Gets additional JDBC connection properties.- Returns:
- JDBC connection properties
-
setProperties
Sets additional JDBC connection properties.- Parameters:
properties- JDBC connection properties
-
getTableName
Gets the target table name.- Returns:
- table name
-
setTableName
Sets the target table name.- Parameters:
tableName- table name
-
getCreateTableSQL
Gets the SQL statement used to create the target table when it does not exist. Use{tableName}and{primaryKey}as placeholders.- Returns:
- table creation SQL
-
setCreateTableSQL
Sets the SQL statement used to create the target table when it does not exist. Use{tableName}and{primaryKey}as placeholders.- Parameters:
createTableSQL- table creation SQL
-
getCreateFieldSQL
Gets the SQL statement used to add a new column when a document field has no matching column. Use{fieldName}as a placeholder.- Returns:
- field/column creation SQL
-
setCreateFieldSQL
Sets the SQL statement used to add a new column when a document field has no matching column. Use{fieldName}as a placeholder.- Parameters:
createFieldSQL- field/column creation SQL
-
getMultiValuesJoiner
Gets the separator used to join multi-valued fields into a single string. Default is "|".- Returns:
- multi-values joiner string
-
setMultiValuesJoiner
Sets the separator used to join multi-valued fields into a single string.- Parameters:
multiValuesJoiner- separator string
-
isFixFieldNames
public boolean isFixFieldNames()Gets whether to sanitize field names to conform to SQL identifier rules.- Returns:
trueif field names are sanitized
-
setFixFieldNames
public void setFixFieldNames(boolean fixFieldNames) Sets whether to sanitize field names to conform to SQL identifier rules.- Parameters:
fixFieldNames-trueto sanitize field names
-
isFixFieldValues
public boolean isFixFieldValues()Gets whether to truncate field values that exceed the column length.- Returns:
trueif field values are truncated
-
setFixFieldValues
public void setFixFieldValues(boolean fixFieldValues) Sets whether to truncate field values that exceed the column length.- Parameters:
fixFieldValues-trueto truncate oversized values
-
getTargetContentField
Gets the SQL column name where the document content is stored. Default is "content".- Returns:
- target content column name
-
setTargetContentField
Sets the SQL column name where the document content is stored.- Parameters:
targetContentField- target content column name
-
getPrimaryKey
Gets the primary key column name.- Returns:
- primary key column name
-
setPrimaryKey
Sets the primary key column name.- Parameters:
primaryKey- primary key column name
-
equals
-
hashCode
public int hashCode() -
toString
-