| org.apache.torque.om.Persistent
All known Subclasses: org.apache.torque.om.BaseObject,
Persistent | public interface Persistent (Code) | | This interface defines methods related to saving an object
author: John D. McNally author: Fedor K. version: $Id: Persistent.java 473821 2006-11-11 22:37:25Z tv $ |
Method Summary | |
ObjectKey | getPrimaryKey() getter for the object primaryKey. | boolean | isModified() Returns whether the object has been modified, since it was
last retrieved from storage. | boolean | isNew() Returns whether the object has ever been saved. | void | save() Saves the object. | void | save(String dbName) Stores the object in the database. | void | save(Connection con) Stores the object in the database. | void | setModified(boolean m) Sets the modified state for the object. | void | setNew(boolean b) Setter for the isNew attribute. | void | setPrimaryKey(ObjectKey primaryKey) Sets the PrimaryKey for the object. | void | setPrimaryKey(String primaryKey) Sets the PrimaryKey for the object. |
getPrimaryKey | ObjectKey getPrimaryKey()(Code) | | getter for the object primaryKey.
the object primaryKey as an Object |
isModified | boolean isModified()(Code) | | Returns whether the object has been modified, since it was
last retrieved from storage.
True if the object has been modified. |
isNew | boolean isNew()(Code) | | Returns whether the object has ever been saved. This will
be false, if the object was retrieved from storage or was created
and then saved.
true, if the object has never been persisted. |
save | void save(String dbName) throws Exception(Code) | | Stores the object in the database. If the object is new,
it inserts it; otherwise an update is performed.
Parameters: dbName - the name of the database throws: Exception - This method might throw an exception |
save | void save(Connection con) throws Exception(Code) | | Stores the object in the database. If the object is new,
it inserts it; otherwise an update is performed. This method
is meant to be used as part of a transaction, otherwise use
the save() method and the connection details will be handled
internally
Parameters: con - the Connection used to store the object throws: Exception - This method might throw an exception |
setModified | void setModified(boolean m)(Code) | | Sets the modified state for the object.
Parameters: m - The new modified state for the object. |
setNew | void setNew(boolean b)(Code) | | Setter for the isNew attribute. This method will be called
by Torque-generated children and Peers.
Parameters: b - the state of the object. |
setPrimaryKey | void setPrimaryKey(ObjectKey primaryKey) throws Exception(Code) | | Sets the PrimaryKey for the object.
Parameters: primaryKey - The new PrimaryKey for the object. throws: Exception - This method might throw an exception |
setPrimaryKey | void setPrimaryKey(String primaryKey) throws Exception(Code) | | Sets the PrimaryKey for the object.
Parameters: primaryKey - the String should be of the form produced byObjectKey.toString(). throws: Exception - This method might throw an exception |
|
|