Deprecated
since 6.2.
because both Source and hbm.xml are deprecated, though this
implementation is instructive
Dialect#getCurrentTimestampSelectString().
This is a select that occurs before the insert or update,
whereas with CurrentTimestampGeneration the select happens afterward.
Underlies the @Source annotation, and <timestamp source="db"/> in
hbm.xml mapping documents.
Source, CurrentTimestampGeneration
| Modifier and Type | Field and Description |
|---|---|
| private static final CoreMessageLogger | |
| private final JavaType | |
| private final CurrentTimestampGeneration. |
| Access | Constructor and Description |
|---|---|
| public | SourceGeneration(Source annotation, Member member, GeneratorCreationContext context)
Deprecated
as a consequence of
Source being deprecated.
|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private static Timestamp | |
| private static Timestamp | |
| public 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. |
| private Timestamp | |
| public EnumSet | Returns: EventTypeSets#INSERT_ONLYImplements org. |
| private static void | |
| private static PreparedStatement |
| log | back to summary |
|---|---|
| private static final CoreMessageLogger log | |
| propertyType | back to summary |
|---|---|
| private final JavaType<?> propertyType | |
| valueGenerator | back to summary |
|---|---|
| private final CurrentTimestampGeneration. | |
| SourceGeneration | back to summary |
|---|---|
| public SourceGeneration(Source annotation, Member member, GeneratorCreationContext context)
Deprecated as a consequence of | |
| SourceGeneration | back to summary |
|---|---|
| public SourceGeneration(SourceType sourceType, Class<?> propertyType, GeneratorCreationContext context) | |
| extractCalledResult | back to summary |
|---|---|
| private static Timestamp extractCalledResult(PreparedStatement statement, JdbcCoordinator coordinator, String sql) throws SQLException | |
| extractResult | back to summary |
|---|---|
| private static Timestamp extractResult(PreparedStatement statement, JdbcCoordinator coordinator, String sql) throws SQLException | |
| generate | back to summary |
|---|---|
| public Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType) Implements org. Doc from org. Generate a value.
| |
| getCurrentTimestamp | back to summary |
|---|---|
| private Timestamp getCurrentTimestamp(SharedSessionContractImplementor session) | |
| getEventTypes | back to summary |
|---|---|
| public 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 | |
| logResult | back to summary |
|---|---|
| private static void logResult(Timestamp ts) | |
| prepareStatement | back to summary |
|---|---|
| private static PreparedStatement prepareStatement(JdbcCoordinator coordinator, String timestampSelectString, boolean callable) | |