Package org.hibernate.tuple
Interface ValueGeneration
-
- All Superinterfaces:
java.io.Serializable
- All Known Subinterfaces:
AnnotationValueGeneration<A>
- All Known Implementing Classes:
CreationTimestampGeneration
,GeneratedValueGeneration
,UpdateTimestampGeneration
,VmValueGeneration
public interface ValueGeneration extends java.io.Serializable
Describes the generation of property values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.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.GenerationTiming
getGenerationTiming()
When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)ValueGenerator<?>
getValueGenerator()
Obtain the in-VM value generator.boolean
referenceColumnInSql()
For values which are generated in the database (getValueGenerator()
==null
), should the column be referenced in the INSERT / UPDATE SQL?
-
-
-
Method Detail
-
getGenerationTiming
GenerationTiming getGenerationTiming()
When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)- Returns:
- When the value is generated.
-
getValueGenerator
ValueGenerator<?> getValueGenerator()
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- Returns:
- The strategy for performing in-VM value generation
-
referenceColumnInSql
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:
true
indicates the column should be included in the SQL.
-
getDatabaseGeneratedReferencedColumnValue
java.lang.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:
- The column value to be used in the SQL.
-
-