Top Description Constructors Methods
org.springframework.jdbc.support.incrementer

public Class PostgresSequenceMaxValueIncrementer

extends AbstractSequenceMaxValueIncrementer
Class Inheritance
Imports
javax.sql.DataSource

DataFieldMaxValueIncrementer that retrieves the next value of a given PostgreSQL sequence.

Thanks to Tomislav Urban for the suggestion!

Author
Juergen Hoeller
Since
4.3.15

Constructor Summary

AccessConstructor and Description
public
PostgresSequenceMaxValueIncrementer()

Default constructor for bean property style usage.

public
PostgresSequenceMaxValueIncrementer(DataSource
the DataSource to use
dataSource
,
String
the name of the sequence/table to use
incrementerName
)

Convenience constructor.

Method Summary

Modifier and TypeMethod and Description
protected String
getSequenceQuery()

Implements abstract org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer.getSequenceQuery.

Return the database-specific query to use for retrieving a sequence value.
Inherited from org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer:
getNextKey

Constructor Detail

PostgresSequenceMaxValueIncrementerback to summary
public PostgresSequenceMaxValueIncrementer()

Default constructor for bean property style usage.

See Also
setDataSource, setIncrementerName
PostgresSequenceMaxValueIncrementerback to summary
public PostgresSequenceMaxValueIncrementer(DataSource dataSource, String incrementerName)

Convenience constructor.

Parameters
dataSource:DataSource

the DataSource to use

incrementerName:String

the name of the sequence/table to use

Method Detail

getSequenceQueryback to summary
protected String getSequenceQuery()

Implements abstract org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer.getSequenceQuery.

Doc from org.springframework.jdbc.support.incrementer.AbstractSequenceMaxValueIncrementer.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.

Annotations
@Override