org.apache.turbine.om
Interface Persistent

All Known Implementing Classes:
BaseObject

public interface Persistent

This interface defines methods related to saving an object

Version:
$Id$
Author:
John D. McNally

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 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(java.lang.String primaryKey)
          Sets the PrimaryKey for the object.
 

Method Detail

getPrimaryKey

public ObjectKey getPrimaryKey()
getter for the object primaryKey.
Returns:
the object primaryKey as an Object

setPrimaryKey

public void setPrimaryKey(ObjectKey primaryKey)
                   throws java.lang.Exception
Sets the PrimaryKey for the object.
Parameters:
ObjectKey - The new PrimaryKey for the object.
Throws:
Exception, - This method might throw an exceptions

setPrimaryKey

public void setPrimaryKey(java.lang.String primaryKey)
                   throws java.lang.Exception
Sets the PrimaryKey for the object.
Parameters:
String, - the String should be of the form produced by ObjectKey.toString().
Throws:
Exception, - This method might throw an exceptions

isModified

public boolean isModified()
Returns whether the object has been modified, since it was last retrieved from storage.
Returns:
True if the object has been modified.

isNew

public boolean isNew()
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.
Returns:
true, if the object has never been persisted.

setNew

public void setNew(boolean b)
Setter for the isNew attribute. This method will be called by Torque-generated children and Peers.
Parameters:
b, - the state of the object.

setModified

public void setModified(boolean m)
Sets the modified state for the object.
Parameters:
m - The new modified state for the object.

save

public void save()
          throws java.lang.Exception
Saves the object.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.