Package org.hibernate.tuple
Class UpdateTimestampGeneration
- java.lang.Object
-
- org.hibernate.tuple.UpdateTimestampGeneration
-
- All Implemented Interfaces:
java.io.Serializable
,AnnotationValueGeneration<UpdateTimestamp>
,ValueGeneration
public class UpdateTimestampGeneration extends java.lang.Object implements AnnotationValueGeneration<UpdateTimestamp>
Value generation implementation forUpdateTimestamp
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UpdateTimestampGeneration()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDatabaseGeneratedReferencedColumnValue()
For values which are generated in the database (ValueGeneration.getValueGenerator()
==null
), if the column will be referenced in the SQL (ValueGeneration.referenceColumnInSql()
==true
), what value should be used in the SQL as the column value.GenerationTiming
getGenerationTiming()
When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)ValueGenerator<?>
getValueGenerator()
Obtain the in-VM value generator.void
initialize(UpdateTimestamp annotation, java.lang.Class<?> propertyType)
Initializes this generation strategy for the given annotation instance.boolean
referenceColumnInSql()
For values which are generated in the database (ValueGeneration.getValueGenerator()
==null
), should the column be referenced in the INSERT / UPDATE SQL?
-
-
-
Method Detail
-
initialize
public void initialize(UpdateTimestamp annotation, java.lang.Class<?> propertyType)
Description copied from interface:AnnotationValueGeneration
Initializes this generation strategy for the given annotation instance.- Specified by:
initialize
in interfaceAnnotationValueGeneration<UpdateTimestamp>
- 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. Implementations may use the type to determine the rightValueGenerator
to be applied.
-
getGenerationTiming
public GenerationTiming getGenerationTiming()
Description copied from interface:ValueGeneration
When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)- Specified by:
getGenerationTiming
in interfaceValueGeneration
- Returns:
- When the value is generated.
-
getValueGenerator
public ValueGenerator<?> getValueGenerator()
Description copied from interface:ValueGeneration
Obtain the in-VM value generator. May returnnull
. In fact for values that are generated "in the database" via execution of the INSERT/UPDATE statement, the expectation is thatnull
be returned here- Specified by:
getValueGenerator
in interfaceValueGeneration
- Returns:
- The strategy for performing in-VM value generation
-
referenceColumnInSql
public boolean referenceColumnInSql()
Description copied from interface:ValueGeneration
For values which are generated in the database (ValueGeneration.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- Specified by:
referenceColumnInSql
in interfaceValueGeneration
- Returns:
true
indicates the column should be included in the SQL.
-
getDatabaseGeneratedReferencedColumnValue
public java.lang.String getDatabaseGeneratedReferencedColumnValue()
Description copied from interface:ValueGeneration
For values which are generated in the database (ValueGeneration.getValueGenerator()
==null
), if the column will be referenced in the SQL (ValueGeneration.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 ('?')- Specified by:
getDatabaseGeneratedReferencedColumnValue
in interfaceValueGeneration
- Returns:
- The column value to be used in the SQL.
-
-