Class PersistableObject<T>

java.lang.Object
net.sf.persism.PersistableObject<T>
All Implemented Interfaces:
Cloneable, Persistable<T>

public abstract class PersistableObject<T> extends Object implements Persistable<T>
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. Data objects can optionally inherit from this class.
Since:
9/15/11 7:14 AM
Author:
Dan Howard
  • Constructor Details

    • PersistableObject

      public PersistableObject()
  • Method Details

    • 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<T>
      Throws:
      PersismException - If an SQL or other exception occurs.
      See Also:
    • readOriginalValue

      public final T readOriginalValue()
      Description copied from interface: Persistable
      Getter (but not a Getter) for the data object in it's original state. The state at the time it was read from the database.
      Specified by:
      readOriginalValue in interface Persistable<T>
      Returns:
      The data object in it's original state.
      See Also:
    • clone

      public final T clone()
      Used by saveReadState for persismOriginalValue
      Overrides:
      clone in class Object
      Returns:
      Clone of T