Package org.omnifaces.persistence.model
Class VersionedEntity<I extends Comparable<I> & Serializable>
java.lang.Object
org.omnifaces.persistence.model.BaseEntity<I>
org.omnifaces.persistence.model.GeneratedIdEntity<I>
org.omnifaces.persistence.model.TimestampedEntity<I>
org.omnifaces.persistence.model.VersionedEntity<I>
- Type Parameters:
I
- The generic ID type.
- All Implemented Interfaces:
Serializable
,Comparable<BaseEntity<I>>
,Identifiable<I>
,Timestamped
,Versioned
@MappedSuperclass
public abstract class VersionedEntity<I extends Comparable<I> & Serializable>
extends TimestampedEntity<I>
implements Versioned
Mapped superclass for versioned entity.
It extends from TimestampedEntity
which in turn extends from GeneratedIdEntity
.
In addition to the "id", "created" and "lastModified" columns, it specifies a Version
column, named "version".
On pre persist, JPA will automatically set version to 0.
On pre update, JPA will automatically increment version with 1.
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
Fields inherited from interface org.omnifaces.persistence.model.Identifiable
ID
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.omnifaces.persistence.model.TimestampedEntity
getCreated, getLastModified, onPrePersist, onPreUpdate, setCreated, setLastModified, skipAdjustLastModified
Methods inherited from class org.omnifaces.persistence.model.GeneratedIdEntity
getId, setId
-
Constructor Details
-
VersionedEntity
public VersionedEntity()
-
-
Method Details
-
getVersion
- Specified by:
getVersion
in interfaceVersioned
-