|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.itracker.model.AbstractEntity
public abstract class AbstractEntity
This is a POJO Business Domain Object. Hibernate Bean.
All entities are Java Beans and should inherit this class to make sure they are Serializable and Cloneable and have the following fields : an id, a creation date and a last modifiation date.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractEntity.CreateDateComparator
|
protected static class |
AbstractEntity.IdComparator
Compares 2 instances by ID. |
protected static class |
AbstractEntity.LastModifiedDateComparator
Compares 2 instances by last modified date. |
| Field Summary | |
|---|---|
static Comparator<AbstractEntity> |
CREATE_DATE_COMPARATOR
|
static Comparator<Entity> |
ID_COMPARATOR
|
static Comparator<AbstractEntity> |
LAST_MODIFIED_DATE_COMPARATOR
|
| Constructor Summary | |
|---|---|
AbstractEntity()
Default constructor (required by Hibernate). |
|
| Method Summary | |
|---|---|
Object |
clone()
|
int |
compareTo(Entity o)
|
boolean |
equals(Object obj)
|
Date |
getCreateDate()
|
Integer |
getId()
Returns the system ID. |
Date |
getLastModifiedDate()
|
int |
hashCode()
|
boolean |
isNew()
Returns whether this instance represents a new transient instance. |
void |
setCreateDate(Date dateTime)
Sets the creation date and time. |
void |
setId(Integer id)
Sets this entity's system ID. |
void |
setLastModifiedDate(Date dateTime)
Sets the last modification date and time. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Comparator<Entity> ID_COMPARATOR
public static final Comparator<AbstractEntity> CREATE_DATE_COMPARATOR
public static final Comparator<AbstractEntity> LAST_MODIFIED_DATE_COMPARATOR
| Constructor Detail |
|---|
public AbstractEntity()
| Method Detail |
|---|
public Integer getId()
Entity
getId in interface Entitypublic void setId(Integer id)
Entity
setId in interface Entityid - ID > 0 for persistent entities,
null for transient onespublic Date getCreateDate()
getCreateDate in interface Entitypublic void setCreateDate(Date dateTime)
The persistence framework automatically sets this property when a new
entity is persisted.
Note that the value is managed by the persistence framework and may be
generated by the database in the future.
The creation time stamp should never change once initialized.
setCreateDate in interface EntitydateTime - creation time stamppublic Date getLastModifiedDate()
getLastModifiedDate in interface Entitypublic void setLastModifiedDate(Date dateTime)
The persistence framework automatically sets this property to the same
value as the createDate property when persisting a new entity and
automatically updates it when saving an existing one.
Note that the value is managed by the persistence framework and may be
generated by the database in the future.
setLastModifiedDate in interface EntitydateTime - last modification time stamppublic boolean isNew()
isNew in interface Entityid is null
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic final boolean equals(Object obj)
equals in class Objectpublic final int compareTo(Entity o)
compareTo in interface Comparable<Entity>public final int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||