public abstract class AbstractIdentityColumnMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
DataFieldMaxValueIncrementer
implementations
which are based on identity columns in a sequence-like table.paddingLength
Constructor and Description |
---|
AbstractIdentityColumnMaxValueIncrementer()
Default constructor for bean property style usage.
|
AbstractIdentityColumnMaxValueIncrementer(DataSource dataSource,
String incrementerName,
String columnName) |
Modifier and Type | Method and Description |
---|---|
protected String |
getDeleteStatement(long[] values)
Statement to use to clean up "sequence" values.
|
protected abstract String |
getIdentityStatement()
Statement to use to obtain the current identity value.
|
protected abstract String |
getIncrementStatement()
Statement to use to increment the "sequence" value.
|
protected long |
getNextKey()
Determine the next key to use, as a long.
|
boolean |
isDeleteSpecificValues()
Return whether to delete the entire range below the current maximum key value
(
false - the default), or the specifically generated values (true ). |
void |
setDeleteSpecificValues(boolean deleteSpecificValues)
Specify whether to delete the entire range below the current maximum key value
(
false - the default), or the specifically generated values (true ). |
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
public AbstractIdentityColumnMaxValueIncrementer()
public AbstractIdentityColumnMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
public void setDeleteSpecificValues(boolean deleteSpecificValues)
false
- the default), or the specifically generated values (true
).
The former mode will use a where range clause whereas the latter will use an in
clause starting with the lowest value minus 1, just preserving the maximum value.public boolean isDeleteSpecificValues()
false
- the default), or the specifically generated values (true
).protected long getNextKey() throws DataAccessException
AbstractDataFieldMaxValueIncrementer
getNextKey
in class AbstractDataFieldMaxValueIncrementer
DataAccessException
protected abstract String getIncrementStatement()
protected abstract String getIdentityStatement()
protected String getDeleteStatement(long[] values)
The default implementation either deletes the entire range below
the current maximum value, or the specifically generated values
(starting with the lowest minus 1, just preserving the maximum value)
- according to the isDeleteSpecificValues()
setting.
values
- the currently generated key values
(the number of values corresponds to AbstractColumnMaxValueIncrementer.getCacheSize()
)