Top Description Methods
org.hibernate.id.enhanced

public Interface DatabaseStructure

extends ExportableProducer
Known Direct Implementers
org.hibernate.id.enhanced.SequenceStructure, org.hibernate.id.enhanced.TableStructure
Imports
org.hibernate.boot.model.relational.Database, .ExportableProducer, .QualifiedName, .SqlStringGenerationContext, org.hibernate.engine.spi.SharedSessionContractImplementor

Encapsulates definition of the underlying data structure backing a sequence-style generator.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public AccessCallback

Returns:

The next value.
buildCallback
(SharedSessionContractImplementor
The session.
session
)

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

public default void
configure(Optimizer
The optimizer being applied to the generator.
optimizer
)

Configures this structure with the given arguments.

public default String[]
getAllSqlForTests()

Deprecated Exposed for tests only.
public int

Returns:

The configured increment size
getIncrementSize
()

The configured increment size

public int

Returns:

The configured initial value
getInitialValue
()

The configured initial value

public default String
getName()

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

Returns:

The structure name.
getPhysicalName
()

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

public int

Returns:

The number of accesses.
getTimesAccessed
()

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

public default void
initialize(SqlStringGenerationContext
A context to help generate SQL strings
context
)

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

public boolean

Returns:

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

Is the structure physically a sequence?

public default void
prepare(Optimizer
The optimizer being applied to the generator.
optimizer
)

Deprecated Use configure(Optimizer) instead.
Prepare this structure for use.
public void
registerExportables(Database
The database instance
database
)

Redeclares org.hibernate.boot.model.relational.ExportableProducer.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).

Method Detail

buildCallbackback to summary
public AccessCallback buildCallback(SharedSessionContractImplementor session)

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.

configureback to summary
public default void configure(Optimizer optimizer)

Configures this structure with the given arguments.

Called just after instantiation, before initialize(SqlStringGenerationContext)

Parameters
optimizer:Optimizer

The optimizer being applied to the generator.

getAllSqlForTestsback to summary
public default String[] getAllSqlForTests()

Deprecated

Exposed for tests only.

Annotations
@Deprecated
getIncrementSizeback to summary
public int getIncrementSize()

The configured increment size

Returns:int

The configured increment size

getInitialValueback to summary
public int getInitialValue()

The configured initial value

Returns:int

The configured initial value

getNameback to summary
public default String getName()

Deprecated

Use getPhysicalName() instead.

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

Annotations
@Deprecated
getPhysicalNameback to summary
public QualifiedName getPhysicalName()

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

Only available after registerExportables(Database) has been called.

Returns:QualifiedName

The structure name.

getTimesAccessedback to summary
public int getTimesAccessed()

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

Returns:int

The number of accesses.

initializeback to summary
public default void initialize(SqlStringGenerationContext context)

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

isPhysicalSequenceback to summary
public boolean isPhysicalSequence()

Is the structure physically a sequence?

Returns:boolean

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

prepareback to summary
public default void prepare(Optimizer optimizer)

Deprecated

Use configure(Optimizer) instead.

Prepare this structure for use. Called sometime after instantiation, but before first use.

Parameters
optimizer:Optimizer

The optimizer being applied to the generator.

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

Redeclares org.hibernate.boot.model.relational.ExportableProducer.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