org.springframework.jdbc.support.incrementer
Class HsqlSequenceMaxValueIncrementer
java.lang.Object
org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
org.springframework.jdbc.support.incrementer.HsqlSequenceMaxValueIncrementer
- All Implemented Interfaces:
- InitializingBean, DataFieldMaxValueIncrementer
public class HsqlSequenceMaxValueIncrementer
- extends AbstractSequenceMaxValueIncrementer
DataFieldMaxValueIncrementer
that retrieves the next value of a given HSQL sequence.
Thanks to Guillaume Bilodeau for the suggestion!
NOTE: This is an alternative to using a regular table to support generating
unique keys that was necessary in previous versions of HSQL.
- Since:
- 2.5
- Author:
- Thomas Risberg
- See Also:
HsqlMaxValueIncrementer
Method Summary |
protected String |
getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HsqlSequenceMaxValueIncrementer
public HsqlSequenceMaxValueIncrementer()
- Default constructor for bean property style usage.
- See Also:
AbstractDataFieldMaxValueIncrementer.setDataSource(javax.sql.DataSource)
,
AbstractDataFieldMaxValueIncrementer.setIncrementerName(java.lang.String)
HsqlSequenceMaxValueIncrementer
public HsqlSequenceMaxValueIncrementer(DataSource dataSource,
String incrementerName)
- Convenience constructor.
- Parameters:
dataSource
- the DataSource to useincrementerName
- the name of the sequence/table to use
getSequenceQuery
protected String getSequenceQuery()
- Description copied from class:
AbstractSequenceMaxValueIncrementer
- Return the database-specific query to use for retrieving a sequence value.
The provided SQL is supposed to result in a single row with a single
column that allows for extracting a long
value.
- Specified by:
getSequenceQuery
in class AbstractSequenceMaxValueIncrementer