Package org.apache.torque.om
Interface ObjectModel
- All Known Subinterfaces:
Persistent
public interface ObjectModel
This interface defines methods related to object referencing and tracking
- Version:
- $Id: Persistent.java 1152582 2011-07-31 13:59:17Z tfischer $
- Author:
- Thomas Vandahl
-
Method Summary
Modifier and TypeMethodDescriptionObjectKey<?> getter for the object primaryKey.booleanReturns whether the object has been modified, since it was last retrieved from storage.booleanisNew()Returns whether the object has ever been saved.voidsetModified(boolean m) Sets the modified state for the object.voidsetNew(boolean b) Setter for the isNew attribute.voidsetPrimaryKey(String primaryKey) Sets the PrimaryKey for the object.voidsetPrimaryKey(ObjectKey<?> primaryKey) Sets the PrimaryKey for the object.
-
Method Details
-
getPrimaryKey
ObjectKey<?> getPrimaryKey()getter for the object primaryKey.- Returns:
- the object primaryKey as an Object
-
setPrimaryKey
Sets the PrimaryKey for the object.- Parameters:
primaryKey- The new PrimaryKey for the object.- Throws:
TorqueException- This method might throw an exception
-
setPrimaryKey
Sets the PrimaryKey for the object.- Parameters:
primaryKey- the String should be of the form produced by ObjectKey.toString().- Throws:
TorqueException- This method might throw an exception
-
isModified
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
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
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
void setModified(boolean m) Sets the modified state for the object.- Parameters:
m- The new modified state for the object.
-