Package org.hibernate.tuple
Class CreationTimestampGeneration
- java.lang.Object
-
- org.hibernate.tuple.CreationTimestampGeneration
-
- All Implemented Interfaces:
Serializable
,AnnotationBasedGenerator<CreationTimestamp>
,BeforeExecutionGenerator
,Generator
,OnExecutionGenerator
,AnnotationValueGeneration<CreationTimestamp>
,ValueGeneration
@Internal @Deprecated(since="6.2") @Remove public class CreationTimestampGeneration extends Object implements AnnotationValueGeneration<CreationTimestamp>
Deprecated.Value generation implementation forCreationTimestamp
, no longer used.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CreationTimestampGeneration()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
getDatabaseGeneratedReferencedColumnValue()
Deprecated.A SQL expression indicating how to calculate the generated value when the property value is generated in the database and the mapped column is included in the SQL statement.String
getDatabaseGeneratedReferencedColumnValue(Dialect dialect)
Deprecated.A SQL expression indicating how to calculate the generated value when the property value is generated in the database and the mapped column is included in the SQL statement.GenerationTiming
getGenerationTiming()
Deprecated.Specifies that the property value is generated: when the entity is inserted, when the entity is updated, whenever the entity is inserted or updated, or never.ValueGenerator<?>
getValueGenerator()
Deprecated.Obtain the Java value generator, if the value is generated in Java, or returnnull
if the value is generated by the database.void
initialize(CreationTimestamp annotation, Class<?> propertyType)
Deprecated.Initializes this generation strategy for the given annotation instance.boolean
referenceColumnInSql()
Deprecated.Determines if the column whose value is generated is included in the column list of the SQLinsert
orupdate
statement, in the case where the value is generated by the database.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.tuple.AnnotationValueGeneration
initialize
-
Methods inherited from interface org.hibernate.generator.Generator
generatesOnInsert, generatesOnUpdate, generatesSometimes
-
Methods inherited from interface org.hibernate.generator.OnExecutionGenerator
getGeneratedIdentifierDelegate, getUniqueKeyPropertyNames
-
Methods inherited from interface org.hibernate.tuple.ValueGeneration
generate, generatedOnExecution, getEventTypes, getReferencedColumnValues, referenceColumnsInSql, writePropertyValue
-
-
-
-
Method Detail
-
initialize
public void initialize(CreationTimestamp annotation, Class<?> propertyType)
Deprecated.Description copied from interface:AnnotationValueGeneration
Initializes this generation strategy for the given annotation instance.- Specified by:
initialize
in interfaceAnnotationValueGeneration<CreationTimestamp>
- Parameters:
annotation
- an instance of the strategy's annotation type. Typically, implementations will retrieve the annotation's attribute values and store them in fields.propertyType
- the type of the property annotated with the generator annotation.
-
getGenerationTiming
public GenerationTiming getGenerationTiming()
Deprecated.Description copied from interface:ValueGeneration
Specifies that the property value is generated:- Specified by:
getGenerationTiming
in interfaceValueGeneration
- Returns:
- The
GenerationTiming
specifying when the value is generated.
-
getValueGenerator
public ValueGenerator<?> getValueGenerator()
Deprecated.Description copied from interface:ValueGeneration
Obtain the Java value generator, if the value is generated in Java, or returnnull
if the value is generated by the database.- Specified by:
getValueGenerator
in interfaceValueGeneration
- Returns:
- The value generator
-
referenceColumnInSql
public boolean referenceColumnInSql()
Deprecated.Description copied from interface:ValueGeneration
Determines if the column whose value is generated is included in the column list of the SQLinsert
orupdate
statement, in the case where the value is generated by the database. For example, this method should return:true
if the value is generated by calling a SQL function likecurrent_timestamp
, orfalse
if the value is generated by a trigger, bygenerated always as
, or using a column default value.
If the value is generated in Java, this method is not called, and so for backward compatibility with Hibernate 5 it is permitted to return any value. On the other hand, when a property value is generated in Java, the column certainly must be included in the column list, and so it's most correct for this method to return
true
!- Specified by:
referenceColumnInSql
in interfaceValueGeneration
- Returns:
true
if the column is included in the column list of the SQL statement.
-
getDatabaseGeneratedReferencedColumnValue
public String getDatabaseGeneratedReferencedColumnValue()
Deprecated.Description copied from interface:ValueGeneration
A SQL expression indicating how to calculate the generated value when the property value is generated in the database and the mapped column is included in the SQL statement. The SQL expression might be:- a function call like
current_timestamp
ornextval('mysequence')
, or - a syntactic marker like
default
.
When the property value is generated in Java, this method is not called, and its value is implicitly the string
"?"
, that is, a JDBC parameter to which the generated value is bound.- Specified by:
getDatabaseGeneratedReferencedColumnValue
in interfaceValueGeneration
- Returns:
- The column value to be used in the generated SQL statement.
- a function call like
-
getDatabaseGeneratedReferencedColumnValue
public String getDatabaseGeneratedReferencedColumnValue(Dialect dialect)
Deprecated.Description copied from interface:ValueGeneration
A SQL expression indicating how to calculate the generated value when the property value is generated in the database and the mapped column is included in the SQL statement. The SQL expression might be:- a function call like
current_timestamp
ornextval('mysequence')
, or - a syntactic marker like
default
.
When the property value is generated in Java, this method is not called, and its value is implicitly the string
"?"
, that is, a JDBC parameter to which the generated value is bound.- Specified by:
getDatabaseGeneratedReferencedColumnValue
in interfaceValueGeneration
- Parameters:
dialect
- The SQL dialect, allowing generation of an expression in dialect-specific SQL.- Returns:
- The column value to be used in the generated SQL statement.
- a function call like
-
-