Top Description Methods
org.hibernate.tuple

public Interface ValueGeneration

extends Serializable
Known Direct Subinterfaces
org.hibernate.tuple.AnnotationValueGeneration
Known Direct Implementers
org.hibernate.cfg.annotations.PropertyBinder.NoValueGeneration
Imports
java.io.Serializable

Describes the generation of property values.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The column value to be used in the SQL.
getDatabaseGeneratedReferencedColumnValue
()

For values which are generated in the database (getValueGenerator == null), if the column will be referenced in the SQL (referenceColumnInSql() == true), what value should be used in the SQL as the column value.

public GenerationTiming

Returns:

When the value is generated.
getGenerationTiming
()

When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)

public ValueGenerator<?>

Returns:

The strategy for performing in-VM value generation
getValueGenerator
()

Obtain the in-VM value generator.

public boolean

Returns:

true indicates the column should be included in the SQL.
referenceColumnInSql
()

For values which are generated in the database (getValueGenerator() == null), should the column be referenced in the INSERT / UPDATE SQL?

public default boolean
timingMatches(GenerationTiming timing)

Does this value generation occur with the given timing?

Method Detail

getDatabaseGeneratedReferencedColumnValueback to summary
public String getDatabaseGeneratedReferencedColumnValue()

For values which are generated in the database (getValueGenerator == null), if the column will be referenced in the SQL (referenceColumnInSql() == true), what value should be used in the SQL as the column value.

Generally this will be a function call or a marker (DEFAULTS).

NOTE : for in-VM generation, this will not be called and the column value will implicitly be a JDBC parameter ('?')

Returns:String

The column value to be used in the SQL.

getGenerationTimingback to summary
public GenerationTiming getGenerationTiming()

When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)

Returns:GenerationTiming

When the value is generated.

getValueGeneratorback to summary
public ValueGenerator<?> getValueGenerator()

Obtain the in-VM value generator.

May return null. In fact for values that are generated "in the database" via execution of the INSERT/UPDATE statement, the expectation is that null be returned here

Returns:ValueGenerator<?>

The strategy for performing in-VM value generation

referenceColumnInSqlback to summary
public boolean referenceColumnInSql()

For values which are generated in the database (getValueGenerator() == null), should the column be referenced in the INSERT / UPDATE SQL?

This will be false most often to have a DDL-defined DEFAULT value be applied on INSERT

Returns:boolean

true indicates the column should be included in the SQL.

timingMatchesback to summary
public default boolean timingMatches(GenerationTiming timing)

Does this value generation occur with the given timing?