Package org.apache.torque.oid
Class SequenceIdGenerator
- java.lang.Object
-
- org.apache.torque.oid.AbstractIdGenerator
-
- org.apache.torque.oid.SequenceIdGenerator
-
- All Implemented Interfaces:
IdGenerator
public class SequenceIdGenerator extends AbstractIdGenerator
This generator works with databases that have an sql syntax for getting an id prior to inserting a row into the database.- Version:
- $Id: SequenceIdGenerator.java 1850586 2019-01-06 18:46:35Z tv $
- Author:
- John D. McNally
-
-
Field Summary
-
Fields inherited from class org.apache.torque.oid.AbstractIdGenerator
adapter, databaseName
-
-
Constructor Summary
Constructors Constructor Description SequenceIdGenerator(Adapter adapter, String databaseName)
Creates an IdGenerator which will work with the specified database.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isConnectionRequired()
A flag to determine whether a Connection is required to generate an id.boolean
isGetGeneratedKeysSupported()
A flag to determine whether Statement#getGeneratedKeys() should be used.boolean
isPostInsert()
A flag to determine the timing of the id generationboolean
isPriorToInsert()
A flag to determine the timing of the id generation-
Methods inherited from class org.apache.torque.oid.AbstractIdGenerator
getId, getIdAsBigDecimal, getIdAsInt, getIdAsLong, getIdAsString, getIdSql
-
-
-
-
Method Detail
-
isPriorToInsert
public boolean isPriorToInsert()
A flag to determine the timing of the id generation- Specified by:
isPriorToInsert
in interfaceIdGenerator
- Specified by:
isPriorToInsert
in classAbstractIdGenerator
- Returns:
- a
boolean
value
-
isPostInsert
public boolean isPostInsert()
A flag to determine the timing of the id generation- Specified by:
isPostInsert
in interfaceIdGenerator
- Specified by:
isPostInsert
in classAbstractIdGenerator
- Returns:
- a
boolean
value
-
isConnectionRequired
public boolean isConnectionRequired()
A flag to determine whether a Connection is required to generate an id.- Specified by:
isConnectionRequired
in interfaceIdGenerator
- Specified by:
isConnectionRequired
in classAbstractIdGenerator
- Returns:
- a
boolean
value
-
isGetGeneratedKeysSupported
public boolean isGetGeneratedKeysSupported()
A flag to determine whether Statement#getGeneratedKeys() should be used.- Specified by:
isGetGeneratedKeysSupported
in interfaceIdGenerator
- Specified by:
isGetGeneratedKeysSupported
in classAbstractIdGenerator
- Returns:
- a
boolean
value
-
-