Top Description Fields Constructors Methods
org.hibernate.id.enhanced

public Class SequenceStructure

extends Object
implements DatabaseStructure
Class Inheritance
All Implemented Interfaces
org.hibernate.id.enhanced.DatabaseStructure, org.hibernate.boot.model.relational.ExportableProducer
Imports
java.sql.PreparedStatement, .ResultSet, .SQLException, org.hibernate.AssertionFailure, org.hibernate.boot.model.relational.Database, .Namespace, .QualifiedName, .Sequence, .SqlStringGenerationContext, org.hibernate.engine.jdbc.env.spi.JdbcEnvironment, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.id.IdentifierGeneratorHelper, .IntegralDataTypeHolder, org.hibernate.internal.CoreMessageLogger, org.jboss.logging.Logger

Describes a sequence.
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private int
private boolean
private String
private final int
private final int
private static final CoreMessageLogger
private final QualifiedName
private final Class<T>
protected QualifiedName
private String

Constructor Summary

AccessConstructor and Description
public
SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, Class<T> numberType)

Method Summary

Modifier and TypeMethod and Description
public AccessCallback
buildCallback(final SharedSessionContractImplementor
The session.
session
)

Implements org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

A callback to be able to get the next value from the underlying structure as needed.
protected void
public void
configure(Optimizer
The optimizer being applied to the generator.
optimizer
)

Overrides default org.hibernate.id.enhanced.DatabaseStructure.configure.

Configures this structure with the given arguments.
public String[]
public int
public int
public String
getName()

Overrides default org.hibernate.id.enhanced.DatabaseStructure.getName.

Deprecated
The name of the database structure (table or sequence).
public QualifiedName
getPhysicalName()

Implements org.hibernate.id.enhanced.DatabaseStructure.getPhysicalName.

The physical name of the database structure (table or sequence).
protected QualifiedName
protected final int
public int
getTimesAccessed()

Implements org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

How many times has this structure been accessed through this reference?
public void
initialize(SqlStringGenerationContext
A context to help generate SQL strings
context
)

Overrides default org.hibernate.id.enhanced.DatabaseStructure.initialize.

Initializes this structure, in particular pre-generates SQL as necessary.
public boolean
isPhysicalSequence()

Implements org.hibernate.id.enhanced.DatabaseStructure.isPhysicalSequence.

Is the structure physically a sequence?
public void
registerExportables(Database
The database instance
database
)

Implements org.hibernate.id.enhanced.DatabaseStructure.registerExportables.

Register database objects involved in this structure, e.g. sequences, tables, etc.

This method is called just once, after configure(Optimizer), but before initialize(SqlStringGenerationContext).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessCounterback to summary
private int accessCounter
applyIncrementSizeToSourceValuesback to summary
private boolean applyIncrementSizeToSourceValues
formattedSequenceNameForLegacyGetterback to summary
private String formattedSequenceNameForLegacyGetter

Deprecated

Annotations
@Deprecated
incrementSizeback to summary
private final int incrementSize
initialValueback to summary
private final int initialValue
LOGback to summary
private static final CoreMessageLogger LOG
logicalQualifiedSequenceNameback to summary
private final QualifiedName logicalQualifiedSequenceName
numberTypeback to summary
private final Class<T> numberType
physicalSequenceNameback to summary
protected QualifiedName physicalSequenceName
sqlback to summary
private String sql

Constructor Detail

SequenceStructureback to summary
public SequenceStructure(JdbcEnvironment jdbcEnvironment, QualifiedName qualifiedSequenceName, int initialValue, int incrementSize, Class<T> numberType)

Method Detail

buildCallbackback to summary
public AccessCallback buildCallback(final SharedSessionContractImplementor session)

Implements org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

Doc from org.hibernate.id.enhanced.DatabaseStructure.buildCallback.

A callback to be able to get the next value from the underlying structure as needed.

Parameters
session:SharedSessionContractImplementor

The session.

Returns:AccessCallback

The next value.

Annotations
@Override
buildSequenceback to summary
protected void buildSequence(Database database)
configureback to summary
public void configure(Optimizer optimizer)

Overrides default org.hibernate.id.enhanced.DatabaseStructure.configure.

Doc from org.hibernate.id.enhanced.DatabaseStructure.configure.

Configures this structure with the given arguments.

Called just after instantiation, before initialize(SqlStringGenerationContext)

Parameters
optimizer:Optimizer

The optimizer being applied to the generator.

Annotations
@Override
getAllSqlForTestsback to summary
public String[] getAllSqlForTests()

Overrides default org.hibernate.id.enhanced.DatabaseStructure.getAllSqlForTests.

Annotations
@Override
getIncrementSizeback to summary
public int getIncrementSize()

Implements org.hibernate.id.enhanced.DatabaseStructure.getIncrementSize.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getIncrementSize.

The configured increment size

Returns:int

The configured increment size

Annotations
@Override
getInitialValueback to summary
public int getInitialValue()

Implements org.hibernate.id.enhanced.DatabaseStructure.getInitialValue.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getInitialValue.

The configured initial value

Returns:int

The configured initial value

Annotations
@Override
getNameback to summary
public String getName()

Overrides default org.hibernate.id.enhanced.DatabaseStructure.getName.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getName.

Deprecated

The name of the database structure (table or sequence).

Annotations
@Override
@Deprecated
getPhysicalNameback to summary
public QualifiedName getPhysicalName()

Implements org.hibernate.id.enhanced.DatabaseStructure.getPhysicalName.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getPhysicalName.

The physical name of the database structure (table or sequence).

Only available after registerExportables(Database) has been called.

Returns:QualifiedName

The structure name.

Annotations
@Override
getQualifiedNameback to summary
protected QualifiedName getQualifiedName()
getSourceIncrementSizeback to summary
protected final int getSourceIncrementSize()
getTimesAccessedback to summary
public int getTimesAccessed()

Implements org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

Doc from org.hibernate.id.enhanced.DatabaseStructure.getTimesAccessed.

How many times has this structure been accessed through this reference?

Returns:int

The number of accesses.

Annotations
@Override
initializeback to summary
public void initialize(SqlStringGenerationContext context)

Overrides default org.hibernate.id.enhanced.DatabaseStructure.initialize.

Doc from org.hibernate.id.enhanced.DatabaseStructure.initialize.

Initializes this structure, in particular pre-generates SQL as necessary.

This method is called just once, after registerExportables(Database), before first use.

Parameters
context:SqlStringGenerationContext

A context to help generate SQL strings

Annotations
@Override
isPhysicalSequenceback to summary
public boolean isPhysicalSequence()

Implements org.hibernate.id.enhanced.DatabaseStructure.isPhysicalSequence.

Doc from org.hibernate.id.enhanced.DatabaseStructure.isPhysicalSequence.

Is the structure physically a sequence?

Returns:boolean

true if the actual database structure is a sequence; false otherwise.

Annotations
@Override
registerExportablesback to summary
public void registerExportables(Database database)

Implements org.hibernate.id.enhanced.DatabaseStructure.registerExportables.

Doc from org.hibernate.id.enhanced.DatabaseStructure.registerExportables.

Register database objects involved in this structure, e.g. sequences, tables, etc.

This method is called just once, after configure(Optimizer), but before initialize(SqlStringGenerationContext).

Parameters
database:Database

The database instance

Annotations
@Override