public abstract class

AbstractSequenceMaxValueIncrementer

extends AbstractDataFieldMaxValueIncrementer
java.lang.Object
   ↳ org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
     ↳ org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer
Known Direct Subclasses

Class Overview

Abstract base class for DataFieldMaxValueIncrementer implementations that use a database sequence. Subclasses need to provide the database-specific SQL to use.

Summary

[Expand]
Inherited Fields
From class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
Public Constructors
AbstractSequenceMaxValueIncrementer()
Default constructor for bean property style usage.
AbstractSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)
Convenience constructor.
Protected Methods
long getNextKey()
Executes the SQL as specified by getSequenceQuery().
abstract String getSequenceQuery()
Return the database-specific query to use for retrieving a sequence value.
[Expand]
Inherited Methods
From class org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.jdbc.support.incrementer.DataFieldMaxValueIncrementer

Public Constructors

public AbstractSequenceMaxValueIncrementer ()

Default constructor for bean property style usage.

public AbstractSequenceMaxValueIncrementer (DataSource dataSource, String incrementerName)

Convenience constructor.

Parameters
dataSource the DataSource to use
incrementerName the name of the sequence/table to use

Protected Methods

protected long getNextKey ()

Executes the SQL as specified by getSequenceQuery().

Returns
  • the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.

protected abstract String getSequenceQuery ()

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.