Serializable
, Cloneable
, Comparable<Entity>
, Entity
Component
, Configuration
, CustomField
, CustomFieldValue
, ImportDataModel
, Issue
, IssueActivity
, IssueAttachment
, IssueField
, IssueHistory
, IssueRelation
, Language
, NameValuePair
, Notification
, Permission
, Project
, ProjectScript
, Report
, SystemConfiguration
, User
, UserPreferences
, Version
, WorkflowScript
public abstract class AbstractEntity extends Object implements Entity
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.
Modifier and Type | Class | Description |
---|---|---|
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.
|
Modifier and Type | Field | Description |
---|---|---|
static Comparator<AbstractEntity> |
CREATE_DATE_COMPARATOR |
|
static Comparator<Entity> |
ID_COMPARATOR |
|
static Comparator<AbstractEntity> |
LAST_MODIFIED_DATE_COMPARATOR |
Constructor | Description |
---|---|
AbstractEntity() |
Default constructor (required by Hibernate).
|
Modifier and Type | Method | Description |
---|---|---|
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.
|
public static final Comparator<Entity> ID_COMPARATOR
public static final Comparator<AbstractEntity> CREATE_DATE_COMPARATOR
public static final Comparator<AbstractEntity> LAST_MODIFIED_DATE_COMPARATOR
public AbstractEntity()
public void setId(Integer id)
Entity
public Date getCreateDate()
getCreateDate
in interface Entity
public 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 Entity
dateTime
- creation time stamppublic Date getLastModifiedDate()
getLastModifiedDate
in interface Entity
public 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 Entity
dateTime
- last modification time stamppublic boolean isNew()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public final int compareTo(Entity o)
compareTo
in interface Comparable<Entity>
Copyright © 2002–2019 itracker. All rights reserved.