org.hibernate.generator.Generator for @Version
properties. This implementation simply delegates back to:
org.hibernate.type.descriptor.java.VersionJavaType#seed to seed an initial version, and
org.hibernate.type.descriptor.java.VersionJavaType#next 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.
| Modifier and Type | Field and Description |
|---|---|
| private final EntityVersionMapping |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| 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 current, EventType nullThe type of event that has triggered generation of a new value eventType)Implements org. |
| public EnumSet | getEventTypes()
Implements org. |
| versionMapping | back to summary |
|---|---|
| private final EntityVersionMapping versionMapping | |
| VersionGeneration | back to summary |
|---|---|
| public VersionGeneration(EntityVersionMapping versionMapping) | |
| generate | back to summary |
|---|---|
| public Object generate(SharedSessionContractImplementor session, Object owner, Object current, EventType eventType) Implements org. Doc from org. Generate a value.
| |
| 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 | |