Package org.hibernate.tuple
Interface ValueGeneration
-
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
AnnotationValueGeneration<A>
- All Known Implementing Classes:
CreationTimestampGeneration,GeneratedValueGeneration,UpdateTimestampGeneration,VmValueGeneration
public interface ValueGeneration extends Serializable
Describes the generation of property values.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description StringgetDatabaseGeneratedReferencedColumnValue()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.GenerationTiminggetGenerationTiming()When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)ValueGenerator<?>getValueGenerator()Obtain the in-VM value generator.booleanreferenceColumnInSql()For values which are generated in the database (getValueGenerator()==null), should the column be referenced in the INSERT / UPDATE SQL?default booleantimingMatches(GenerationTiming timing)Does this value generation occur with the given timing?
-
-
-
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 thatnullbe 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:
trueindicates the column should be included in the SQL.
-
getDatabaseGeneratedReferencedColumnValue
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.
-
timingMatches
default boolean timingMatches(GenerationTiming timing)
Does this value generation occur with the given timing?
-
-