001    package net.sf.persism;
002    
003    /**
004     * Interface for PersistableObject class. You can use this interface in situations where you can't or don't want
005     * your data objects to inherit PersistableObject.
006     *
007     * @author Dan Howard
008     * @see PersistableObject PersistableObject for implementation.
009     * @since 10/8/11 9:51 AM
010     */
011    public interface Persistable {
012    
013        /**
014         * Saves the current state of the data object to later detect changes for SQL UPDATE statements.
015         * Persism calls this method internally, you usually don't have to call this method yourself.
016         *
017         * @throws PersismException If an SQL or other exception occurs.
018         */
019        void saveReadState() throws PersismException;
020    
021        /**
022         * Getter for the data object in it's original state. The state at the time it was read from the database.
023         *
024         * @return The data object in it's original state.
025         */
026        Persistable getOriginalValue();
027    }