public abstract class AbstractSequenceMaxValueIncrementer extends AbstractDataFieldMaxValueIncrementer
DataFieldMaxValueIncrementer implementations that use
a database sequence. Subclasses need to provide the database-specific SQL to use.getSequenceQuery()paddingLength| Constructor and Description |
|---|
AbstractSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
|
AbstractSequenceMaxValueIncrementer(DataSource dataSource,
String incrementerName)
Convenience constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected long |
getNextKey()
Executes the SQL as specified by
getSequenceQuery(). |
protected abstract String |
getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
|
afterPropertiesSet, getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLengthpublic AbstractSequenceMaxValueIncrementer()
public AbstractSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
dataSource - the DataSource to useincrementerName - the name of the sequence/table to useprotected long getNextKey()
throws DataAccessException
getSequenceQuery().getNextKey in class AbstractDataFieldMaxValueIncrementerDataAccessExceptionprotected abstract String getSequenceQuery()
The provided SQL is supposed to result in a single row with a single
column that allows for extracting a long value.