|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
IEntity defines a basic interface for data objects representing a single instance of a data row/record from a persistent data storage. An entity contains several fields of data accessible using the setData() and getData() methods. Note that the contained fields are not defined as ordered by this interface and are instead adressed using their IFieldDescriptor.
Field Summary | |
static int |
DIRTY
Status flag that sinifies that an entity has unsaved changes since creation or last syncronization with the persistent storage. |
static int |
EMPTY
Status flag that used for newly creted object that that has had no changes from the default data set at the moment of creation. |
static int |
PERSISTENT
Status flag that is used to signify that the entity reflects data that exists in in a related persistent storage. |
Method Summary | |
void |
addEntityChangeListener(IEntityChangeListener listener)
Adds IEntityChangeListener to receive notifications of changes in the entity's status and data content. |
void |
addEntityListener(IEntityListener listener)
Adds IEntityListener to receive notifications of performed data operations on the entity object. |
void |
clear()
Clear resets all data in the entity to their defalt values and sets the flags to reflect an empty unchanged data entity. |
void |
clearStatusFlag(int flags)
Should not normally be used by standard API users. |
void |
copyData(IDataProvider entitySource)
Copies and replaces the, in the entity, contained data by reading each individual data field as a property from the provided property source. |
void |
delete()
This method will delete the entity from it's related persistent storage. |
boolean |
equals(java.lang.Object entity)
Returns true if the data in all the entities IDENTIY fields are considered equal according to their DataType class. |
boolean |
equalsExactly(java.lang.Object entity)
Compares all data values between the objects if they are of the same type. |
java.lang.Object |
getData(IFieldDescriptor fieldDescriptor)
Returns the data value of the addressed data field. |
IDataSource |
getDataSource()
Returns the data source that the entity object belongs to. |
IEntityDescriptor |
getEntityDescriptor()
Return the entity objects IEntityDescriptor that defines it's type and structure. |
Qualifier |
getOriginQualifier()
Returns a identity qualifier that uniquely qualifies the entity in a persistent storage. |
boolean |
isDataNull(IFieldDescriptor fieldDescriptor)
Returns true if the addressed entity field is contains a NULL value. |
boolean |
isDirty()
Returns true if any entity field in the entity has been changed since creation or the last syncronization with the persistent storage. |
boolean |
isEmpty()
Returns true for newly creted object that that has had no changes from the default data set at the moment of creation. |
boolean |
isFieldDirty(IFieldDescriptor fieldDescriptor)
Returns true if the addressed entity field has been changed since creation or the last syncronization with the persistent storage. |
boolean |
isPersistent()
Returns true if the the entity reflects data that exists in a related persistent storage. |
void |
refresh()
This method will refresh the entity with current data from the related persistent storage. |
void |
removeEntityChangeListener(IEntityChangeListener listener)
Removes the specified IEntityListener from the entity object. |
void |
removeEntityListener(IEntityListener listener)
Removes the specified IEntityListener from the entity object. |
void |
setData(IFieldDescriptor fieldDescriptor,
java.lang.Object data)
Sets the value of the addressed data field. |
void |
setStatusFlag(int flags)
Should not normally be used by standard API users. |
void |
store()
This method will store any unsaved changes in the entity to it's realated persistent storage. |
ValidationResult |
validateData()
Help method that validates the data contained in the called data object and returns a ValidationResult object. |
Methods inherited from interface org.caleigo.core.IDataProvider |
getData |
Methods inherited from interface org.caleigo.core.IDataConsumer |
setData, setData |
Methods inherited from interface java.lang.Comparable |
compareTo |
Field Detail |
public static final int DIRTY
public static final int EMPTY
public static final int PERSISTENT
Method Detail |
public void store()
public void delete()
public void refresh()
public void copyData(IDataProvider entitySource)
public boolean equals(java.lang.Object entity)
public boolean equalsExactly(java.lang.Object entity)
public boolean isDataNull(IFieldDescriptor fieldDescriptor)
public java.lang.Object getData(IFieldDescriptor fieldDescriptor)
InvalidFieldException
public void setData(IFieldDescriptor fieldDescriptor, java.lang.Object data)
InvalidFieldException
ReadOnlyViolationException
public void clear()
public ValidationResult validateData()
public IEntityDescriptor getEntityDescriptor()
public boolean isFieldDirty(IFieldDescriptor fieldDescriptor)
public boolean isDirty()
public boolean isEmpty()
public boolean isPersistent()
public IDataSource getDataSource()
public Qualifier getOriginQualifier()
public void setStatusFlag(int flags)
public void clearStatusFlag(int flags)
public void addEntityListener(IEntityListener listener)
public void removeEntityListener(IEntityListener listener)
public void addEntityChangeListener(IEntityChangeListener listener)
public void removeEntityChangeListener(IEntityChangeListener listener)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |