@MappedSuperclass
public class BaseEntity
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
BaseEntity() |
Modifier and Type | Method and Description |
---|---|
java.util.Date |
getCreated()
Get when this entity was created.
|
java.lang.Long |
getEntityVersion()
Get the version of this entity.
|
java.lang.String |
getId()
Get the id.
|
java.util.Date |
getUpdated()
Get the time this entity was updated.
|
protected void |
onCreateBaseEntity()
Updates the created and updated timestamps to be creation time.
|
protected void |
onUpdateBaseEntity()
On any update to the entity will update the update time.
|
void |
setCreated(java.util.Date created)
Set the created timestamp.
|
protected void |
setEntityVersion(java.lang.Long entityVersion)
Set the version of this entity.
|
void |
setId(java.lang.String id)
Set the id.
|
void |
setUpdated(java.util.Date updated)
Set the time this entity was updated.
|
protected void onCreateBaseEntity()
protected void onUpdateBaseEntity()
public java.lang.String getId()
public void setId(java.lang.String id) throws GeniePreconditionException
id
- The id to set. Not null/empty/blank.GeniePreconditionException
- When precondition isn't met.public java.util.Date getCreated()
public void setCreated(java.util.Date created)
created
- The created timestamppublic java.util.Date getUpdated()
public void setUpdated(java.util.Date updated)
updated
- The updated timestamppublic java.lang.Long getEntityVersion()
protected void setEntityVersion(java.lang.Long entityVersion)
entityVersion
- The new entityVersion