Package org.hibernate.generator.internal
Class SourceGeneration
- java.lang.Object
-
- org.hibernate.generator.internal.SourceGeneration
-
- All Implemented Interfaces:
Serializable
,BeforeExecutionGenerator
,Generator
@Deprecated(since="6.2") @Internal public class SourceGeneration extends Object implements BeforeExecutionGenerator
Deprecated.because bothSource
andhbm.xml
are deprecated, though this implementation is instructiveValue generation strategy using the queryDialect.getCurrentTimestampSelectString()
. This is aselect
that occurs before theinsert
orupdate
, whereas withCurrentTimestampGeneration
theselect
happens afterward.Underlies the
@Source
annotation, and<timestamp source="db"/>
inhbm.xml
mapping documents.- See Also:
Source
,CurrentTimestampGeneration
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SourceGeneration(Source annotation, Member member, GeneratorCreationContext context)
Deprecated.SourceGeneration(SourceType sourceType, Class<?> propertyType, GeneratorCreationContext context)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Object
generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType)
Deprecated.Generate a value.EnumSet<EventType>
getEventTypes()
Deprecated.The event types for which this generator should be called to produce a new value.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.generator.BeforeExecutionGenerator
generatedOnExecution
-
Methods inherited from interface org.hibernate.generator.Generator
allowAssignedIdentifiers, generatedOnExecution, generatesOnInsert, generatesOnUpdate, generatesSometimes
-
-
-
-
Constructor Detail
-
SourceGeneration
public SourceGeneration(Source annotation, Member member, GeneratorCreationContext context)
Deprecated.
-
SourceGeneration
public SourceGeneration(SourceType sourceType, Class<?> propertyType, GeneratorCreationContext context)
Deprecated.
-
-
Method Detail
-
getEventTypes
public EnumSet<EventType> getEventTypes()
Deprecated.Description copied from interface:Generator
The event types for which this generator should be called to produce a new value.Identifier generators must return
EventTypeSets.INSERT_ONLY
.- Specified by:
getEventTypes
in interfaceGenerator
- Returns:
EventTypeSets.INSERT_ONLY
-
generate
public Object generate(SharedSessionContractImplementor session, Object owner, Object currentValue, EventType eventType)
Deprecated.Description copied from interface:BeforeExecutionGenerator
Generate a value.- Specified by:
generate
in interfaceBeforeExecutionGenerator
- Parameters:
session
- The session from which the request originates.owner
- The instance of the object owning the attribute for which we are generating a value.currentValue
- The current value assigned to the property, ornull
eventType
- The type of event that has triggered generation of a new value- Returns:
- The generated value
-
-