Class DefaultDataFieldMaxValueIncrementerFactory
java.lang.Object
org.springframework.batch.item.database.support.DefaultDataFieldMaxValueIncrementerFactory
- All Implemented Interfaces:
DataFieldMaxValueIncrementerFactory
public class DefaultDataFieldMaxValueIncrementerFactory
extends Object
implements DataFieldMaxValueIncrementerFactory
Default implementation of the
DataFieldMaxValueIncrementerFactory interface.
Valid database types are given by the DatabaseType enum.
Note: For MySql databases, the
MySQLMaxValueIncrementer.setUseNewConnection(boolean) will be set to true.
- Author:
- Lucas Ward, Michael Minella, Drummond Dawson, Mahmoud Ben Hassine
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementergetIncrementer(String incrementerType, String incrementerName) Return theDataFieldMaxValueIncrementerfor the provided database type.String[]Returns the list of supported database incrementer typesbooleanisSupportedIncrementerType(String incrementerType) Returns boolean indicated whether or not the provided string is supported by this factory.voidsetIncrementerColumnName(String incrementerColumnName) Public setter for the column name (defaults to "ID") in the incrementer.
-
Constructor Details
-
DefaultDataFieldMaxValueIncrementerFactory
-
-
Method Details
-
setIncrementerColumnName
Public setter for the column name (defaults to "ID") in the incrementer. Only used by some platforms (Derby, HSQL, MySQL, SQL Server and Sybase), and should be fine for use with Spring Batch meta data as long as the default batch schema hasn't been changed.- Parameters:
incrementerColumnName- the primary key column name to set
-
getIncrementer
public org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer getIncrementer(String incrementerType, String incrementerName) Description copied from interface:DataFieldMaxValueIncrementerFactoryReturn theDataFieldMaxValueIncrementerfor the provided database type.- Specified by:
getIncrementerin interfaceDataFieldMaxValueIncrementerFactory- Parameters:
incrementerType- string represented database typeincrementerName- incrementer name to create. In many cases this may be the sequence name- Returns:
- incrementer
-
isSupportedIncrementerType
Description copied from interface:DataFieldMaxValueIncrementerFactoryReturns boolean indicated whether or not the provided string is supported by this factory.- Specified by:
isSupportedIncrementerTypein interfaceDataFieldMaxValueIncrementerFactory- Parameters:
incrementerType-Stringcontaining the database type.- Returns:
- true if the incrementerType is supported by this database type. Else false is returned.
-
getSupportedIncrementerTypes
Description copied from interface:DataFieldMaxValueIncrementerFactoryReturns the list of supported database incrementer types- Specified by:
getSupportedIncrementerTypesin interfaceDataFieldMaxValueIncrementerFactory- Returns:
- an array of
Strings containing the supported incrementer types.
-