This is an older API that predates Generator. It's often cleaner to implement either
BeforeExecutionGenerator or OnExecutionGenerator directly.
AnnotationValueGeneration
| Modifier and Type | Method and Description |
|---|---|
| public default Object | generate(SharedSessionContractImplementor
The session from which the request originates. session, Object The instance of the object owning the attribute for which we are generating a value. owner, Object The current value assigned to the property, or currentValue, EventType nullThe type of event that has triggered generation of a new value eventType)Implements org. |
| public default boolean | Returns: true if the value is generated by the database, or false if it is
generated in Java using a ValueGenerator.Overrides default org. |
| public String | Returns: The column value to be used in the generated SQL statement.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. |
| public default String | Returns: The column value to be used in the generated SQL statement.The SQL dialect, allowing generation of an expression
in dialect-specific SQL. dialect)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. |
| public default EnumSet | getEventTypes()
Implements org. |
| public GenerationTiming | Returns: TheGenerationTiming specifying when the value is generated.
Deprecated
as a consequence of
Specifies that the property value is generated:
GenerationTiming being deprecated.
|
| public default String[] | getReferencedColumnValues(Dialect
The SQL dialect, allowing generation of an expression
in dialect-specific SQL. dialect)Implements org. |
| public ValueGenerator | Returns: The value generator
Deprecated
as a consequence of
Obtain the Java value generator, if the value is generated in
Java, or return ValueGenerator being deprecated.
null if the value is generated by the database.
|
| public boolean | Returns: true if the column is included in the column list of the SQL statement.Determines if the column whose value is generated is included in the column list of the
SQL |
| public default boolean | referenceColumnsInSql(Dialect dialect)
Implements org. insert or update statement.
|
| public default boolean | writePropertyValue()
Implements org. ?
|
| generate | back to summary |
|---|---|
| public default Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType) Implements org. Doc from org. Generate a value.
| |
| generatedOnExecution | back to summary |
|---|---|
| public default boolean generatedOnExecution() Overrides default org. Determines if the property value is generated in Java, or by the database.
This default implementation returns true if the Java
value generator is
| |
| getDatabaseGeneratedReferencedColumnValue | back to summary |
|---|---|
| public String getDatabaseGeneratedReferencedColumnValue() 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:
When the property value is generated in Java, this method is not called, and its value is
implicitly the string
| |
| getDatabaseGeneratedReferencedColumnValue | back to summary |
|---|---|
| public default String getDatabaseGeneratedReferencedColumnValue(Dialect dialect) 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:
When the property value is generated in Java, this method is not called, and its value is
implicitly the string
| |
| getEventTypes | back to summary |
|---|---|
| public default EnumSet Implements org. Doc from org. The event types for which this generator should be called to produce a new value.
Identifier generators must return | |
| getGenerationTiming | back to summary |
|---|---|
| public GenerationTiming getGenerationTiming()
Deprecated as a consequence of Specifies that the property value is generated:
| |
| getReferencedColumnValues | back to summary |
|---|---|
| public default String[] getReferencedColumnValues(Dialect dialect) Implements org. Doc from org. A SQL expression indicating how to calculate the generated values when the mapped columns are included in the SQL statement. The SQL expressions might be:
| |
| getValueGenerator | back to summary |
|---|---|
| public ValueGenerator Deprecated as a consequence of Obtain the Java value generator, if the value is generated in
Java, or return
| |
| referenceColumnInSql | back to summary |
|---|---|
| public boolean referenceColumnInSql() Determines if the column whose value is generated is included in the column list of the
SQL
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
| |
| referenceColumnsInSql | back to summary |
|---|---|
| public default boolean referenceColumnsInSql(Dialect dialect) Implements org. Doc from org. Determines if the columns whose values are generated are included in the column list
of the SQL
| |
| writePropertyValue | back to summary |
|---|---|
| public default boolean writePropertyValue() Implements org. Determines if the property value is written to JDBC as the argument of a JDBC
| |