Package org.omnifaces.persistence.model
Class VersionedBaseEntity<I extends Comparable<I> & Serializable>
- java.lang.Object
-
- org.omnifaces.persistence.model.BaseEntity<I>
-
- org.omnifaces.persistence.model.TimestampedBaseEntity<I>
-
- org.omnifaces.persistence.model.VersionedBaseEntity<I>
-
- Type Parameters:
I
- The generic ID type.
- All Implemented Interfaces:
Serializable
,Comparable<BaseEntity<I>>
,Identifiable<I>
,Timestamped
,Versioned
@MappedSuperclass public abstract class VersionedBaseEntity<I extends Comparable<I> & Serializable> extends TimestampedBaseEntity<I> implements Versioned
Mapped superclass for versioned entity. It extends from
TimestampedBaseEntity
. In addition to the "created" and "lastModified" columns, it specifies aVersion
column, named "version". TheId
column needs to be manually taken care of. 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:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.omnifaces.persistence.model.Identifiable
ID
-
-
Constructor Summary
Constructors Constructor Description VersionedBaseEntity()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Long
getVersion()
-
Methods inherited from class org.omnifaces.persistence.model.TimestampedBaseEntity
getCreated, getLastModified, onPrePersist, onPreUpdate, setCreated, setLastModified, skipAdjustLastModified
-
Methods inherited from class org.omnifaces.persistence.model.BaseEntity
compareTo, equals, hashCode, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.omnifaces.persistence.model.Identifiable
getId, setId
-
-
-
-
Method Detail
-
getVersion
public Long getVersion()
- Specified by:
getVersion
in interfaceVersioned
-
-