public class CreationTimestampGeneration extends Object implements AnnotationValueGeneration<CreationTimestamp>
Value generation implementation for CreationTimestamp.
| Constructor and Description |
|---|
CreationTimestampGeneration() |
| Modifier and Type | Method and Description |
|---|---|
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(CreationTimestamp annotation,
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?
<p/>
This will be false most often to have a DDL-defined DEFAULT value be applied on INSERT |
public void initialize(CreationTimestamp annotation, Class<?> propertyType)
AnnotationValueGenerationInitializes this generation strategy for the given annotation instance.
initialize in interface AnnotationValueGeneration<CreationTimestamp>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 right ValueGenerator to be applied.public GenerationTiming getGenerationTiming()
ValueGenerationWhen is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)
getGenerationTiming in interface ValueGenerationpublic ValueGenerator<?> getValueGenerator()
ValueGenerationObtain the in-VM value generator.
<p/>
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
getValueGenerator in interface ValueGenerationpublic boolean referenceColumnInSql()
ValueGenerationFor values which are generated in the database (ValueGeneration.getValueGenerator() == null), should the
column be referenced in the INSERT / UPDATE SQL?
<p/>
This will be false most often to have a DDL-defined DEFAULT value be applied on INSERT
referenceColumnInSql in interface ValueGenerationtrue indicates the column should be included in the SQL.public String getDatabaseGeneratedReferencedColumnValue()
ValueGenerationFor 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.
<p/>
Generally this will be a function call or a marker (DEFAULTS).
<p/>
NOTE : for in-VM generation, this will not be called and the column value will implicitly be a JDBC parameter ('?')
getDatabaseGeneratedReferencedColumnValue in interface ValueGenerationCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.