Top Description Fields Constructors Methods
org.hibernate.tuple

public Class CreationTimestampGeneration

extends Object
implements AnnotationValueGeneration<CreationTimestamp>
Class Inheritance
All Implemented Interfaces
org.hibernate.tuple.AnnotationValueGeneration, org.hibernate.tuple.ValueGeneration, java.io.Serializable
Imports
org.hibernate.annotations.CreationTimestamp

Value generation implementation for CreationTimestamp.
Author
Gunnar Morling

Field Summary

Modifier and TypeField and Description
private ValueGenerator<?>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getDatabaseGeneratedReferencedColumnValue()

Implements org.hibernate.tuple.ValueGeneration.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
getGenerationTiming()

Implements org.hibernate.tuple.ValueGeneration.getGenerationTiming.

When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)
public ValueGenerator<?>
getValueGenerator()

Implements org.hibernate.tuple.ValueGeneration.getValueGenerator.

Obtain the in-VM value generator.
public void
initialize(CreationTimestamp
an instance of the strategy's annotation type. Typically implementations will retrieve the annotation's attribute values and store them in fields.
annotation
,
Class<?>
the type of the property annotated with the generator annotation. Implementations may use the type to determine the right ValueGenerator to be applied.
propertyType
)

Implements org.hibernate.tuple.AnnotationValueGeneration.initialize.

Initializes this generation strategy for the given annotation instance.
public boolean
referenceColumnInSql()

Implements org.hibernate.tuple.ValueGeneration.referenceColumnInSql.

For values which are generated in the database (getValueGenerator() == null), should the column be referenced in the INSERT / UPDATE SQL?
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

generatorback to summary
private ValueGenerator<?> generator

Constructor Detail

CreationTimestampGenerationback to summary
public CreationTimestampGeneration()

Method Detail

getDatabaseGeneratedReferencedColumnValueback to summary
public String getDatabaseGeneratedReferencedColumnValue()

Implements org.hibernate.tuple.ValueGeneration.getDatabaseGeneratedReferencedColumnValue.

Doc from org.hibernate.tuple.ValueGeneration.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.

Annotations
@Override
getGenerationTimingback to summary
public GenerationTiming getGenerationTiming()

Implements org.hibernate.tuple.ValueGeneration.getGenerationTiming.

Doc from org.hibernate.tuple.ValueGeneration.getGenerationTiming.

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

Returns:GenerationTiming

When the value is generated.

Annotations
@Override
getValueGeneratorback to summary
public ValueGenerator<?> getValueGenerator()

Implements org.hibernate.tuple.ValueGeneration.getValueGenerator.

Doc from org.hibernate.tuple.ValueGeneration.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

Annotations
@Override
initializeback to summary
public void initialize(CreationTimestamp annotation, Class<?> propertyType)

Implements org.hibernate.tuple.AnnotationValueGeneration.initialize.

Doc from org.hibernate.tuple.AnnotationValueGeneration.initialize.

Initializes this generation strategy for the given annotation instance.

Parameters
annotation:CreationTimestamp

an instance of the strategy's annotation type. Typically implementations will retrieve the annotation's attribute values and store them in fields.

propertyType:Class<?>

the type of the property annotated with the generator annotation. Implementations may use the type to determine the right ValueGenerator to be applied.

Annotations
@Override
referenceColumnInSqlback to summary
public boolean referenceColumnInSql()

Implements org.hibernate.tuple.ValueGeneration.referenceColumnInSql.

Doc from org.hibernate.tuple.ValueGeneration.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.

Annotations
@Override