net.sf.persism
Class PersistableObject

java.lang.Object
  extended by net.sf.persism.PersistableObject
All Implemented Interfaces:
Persistable

public abstract class PersistableObject
extends java.lang.Object
implements Persistable

Data objects can optionally inherit from this class. Persism uses information from this class to detect which properties are modified in your data objects and only includes those columns in the SQL UPDATE statements.

Since:
9/15/11 7:14 AM
Author:
Dan Howard

Constructor Summary
PersistableObject()
           
 
Method Summary
 Persistable getOriginalValue()
          Getter for the data object in it's original state.
 void saveReadState()
          Saves the current state of the data object to later detect changes for SQL UPDATE statements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistableObject

public PersistableObject()
Method Detail

saveReadState

public final void saveReadState()
                         throws PersismException
Description copied from interface: Persistable
Saves the current state of the data object to later detect changes for SQL UPDATE statements. Persism calls this method internally, you usually don't have to call this method yourself.

Specified by:
saveReadState in interface Persistable
Throws:
PersismException - If an SQL or other exception occurs.

getOriginalValue

public final Persistable getOriginalValue()
Description copied from interface: Persistable
Getter for the data object in it's original state. The state at the time it was read from the database.

Specified by:
getOriginalValue in interface Persistable
Returns:
The data object in it's original state.