Package org.hibernate.generator.internal
Class VersionGeneration
java.lang.Object
org.hibernate.generator.internal.VersionGeneration
- All Implemented Interfaces:
Serializable
,BeforeExecutionGenerator
,Generator
A default
Generator
for @Version
properties. This implementation simply delegates back to:
VersionJavaType.seed(java.lang.Long, java.lang.Integer, java.lang.Integer, org.hibernate.engine.spi.SharedSessionContractImplementor)
to seed an initial version, andVersionJavaType.next(T, java.lang.Long, java.lang.Integer, java.lang.Integer, org.hibernate.engine.spi.SharedSessionContractImplementor)
to increment a version.
Thus, this implementation reproduces the "classic" behavior of Hibernate. A custom generator specified using a generator annotation will override this implementation, allowing customized versioning.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate
(SharedSessionContractImplementor session, Object owner, Object current, EventType eventType) Generate a value.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, allowMutation, generatedBeforeExecution, generatedOnExecution, generatesOnInsert, generatesOnUpdate, generatesSometimes
-
Constructor Details
-
VersionGeneration
-
-
Method Details
-
getEventTypes
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:
- a set of
EventType
s.
-