wt.clients.util
Class PersistableItem

java.lang.Object
  extended bywt.clients.util.PersistableItem
Direct Known Subclasses:
CAccessEntry, CAccessList, CCriteriaList, CCriterion, CLifeCycleTemplate, CRoleHolder

public class PersistableItem
extends Object

Parent class for client items which contain persistable items. This class keeps track of modified and created items, and knows how to save and refresh those items.


Field Summary
(package private)  boolean created
           
(package private)  boolean modified
           
 
Constructor Summary
PersistableItem()
           
 
Method Summary
 boolean isCreated()
          Returns true if this object is created, else false.
 boolean isModified()
          Returns true if this object is modified, else false.
 void refresh()
          Refreshes the object to it's database state.
 void save()
          Saves the object.
 void setCreated(boolean created)
          Sets the created flag on this object.
 void setModified(boolean modified)
          Sets the modified flag on this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

created

boolean created

modified

boolean modified
Constructor Detail

PersistableItem

public PersistableItem()
Method Detail

save

public void save()
          throws WTException
Saves the object.

Throws:
WTException - if the save fails

refresh

public void refresh()
             throws WTException
Refreshes the object to it's database state.

Throws:
WTException - if the refresh fails

isModified

public boolean isModified()
Returns true if this object is modified, else false.


setModified

public void setModified(boolean modified)
Sets the modified flag on this object.

Parameters:
modified - true if modified, else false.

isCreated

public boolean isCreated()
Returns true if this object is created, else false.


setCreated

public void setCreated(boolean created)
Sets the created flag on this object.

Parameters:
created - true if created, else false.