类 AbstractIdentityColumnMaxValueIncrementer
- java.lang.Object
- org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
- org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
- org.springframework.jdbc.support.incrementer.AbstractIdentityColumnMaxValueIncrementer
- 所有已实现的接口:
InitializingBean
,DataFieldMaxValueIncrementer
- 直接已知子类:
DerbyMaxValueIncrementer
,HsqlMaxValueIncrementer
,SqlServerMaxValueIncrementer
,SybaseMaxValueIncrementer
public abstract class AbstractIdentityColumnMaxValueIncrementer extends AbstractColumnMaxValueIncrementer
Abstract base class forDataFieldMaxValueIncrementer
implementations which are based on identity columns in a sequence-like table.- 从以下版本开始:
- 4.1.2
- 作者:
- Juergen Hoeller, Thomas Risberg
字段概要
从类继承的字段 org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
paddingLength
构造器概要
构造器 构造器 说明 AbstractIdentityColumnMaxValueIncrementer()
Default constructor for bean property style usage.AbstractIdentityColumnMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 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
).从类继承的方法 org.springframework.jdbc.support.incrementer.AbstractColumnMaxValueIncrementer
afterPropertiesSet, getCacheSize, getColumnName, setCacheSize, setColumnName
从类继承的方法 org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
getDataSource, getIncrementerName, getPaddingLength, nextIntValue, nextLongValue, nextStringValue, setDataSource, setIncrementerName, setPaddingLength
构造器详细资料
AbstractIdentityColumnMaxValueIncrementer
public AbstractIdentityColumnMaxValueIncrementer()
Default constructor for bean property style usage.
AbstractIdentityColumnMaxValueIncrementer
public AbstractIdentityColumnMaxValueIncrementer(DataSource dataSource, String incrementerName, String columnName)
方法详细资料
setDeleteSpecificValues
public 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
). 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.
isDeleteSpecificValues
public boolean isDeleteSpecificValues()
Return whether to delete the entire range below the current maximum key value (false
- the default), or the specifically generated values (true
).
getNextKey
protected long getNextKey() throws DataAccessException
从类复制的说明:AbstractDataFieldMaxValueIncrementer
Determine the next key to use, as a long.- 指定者:
getNextKey
在类中AbstractDataFieldMaxValueIncrementer
- 返回:
- the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.
- 抛出:
DataAccessException
getIncrementStatement
protected abstract String getIncrementStatement()
Statement to use to increment the "sequence" value.- 返回:
- the SQL statement to use
getIdentityStatement
protected abstract String getIdentityStatement()
Statement to use to obtain the current identity value.- 返回:
- the SQL statement to use
getDeleteStatement
protected String getDeleteStatement(long[] values)
Statement to use to clean up "sequence" 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 toAbstractColumnMaxValueIncrementer.getCacheSize()
)- 返回:
- the SQL statement to use