|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hydrateframework.AbstractHydrateObject
public abstract class AbstractHydrateObject
This class implements the HydrateObject
interface and provides a
base class for generated object implementations. This implements code to keep
track of the ownership of the object and the object's state.
Field Summary |
---|
Fields inherited from interface org.hydrateframework.HydrateObject |
---|
ATTR_MANDATORY, ATTR_MULTIPLE, ATTR_MULTIPLEOPTIONAL, ATTR_NONE, ATTR_OPTIONAL, saveALL, savePOST, savePRE, STATECHANGED, STATEPOSTSAVE, STATEPRESAVE, STATEUNCHANGED, STATEUPDATING |
Constructor Summary | |
---|---|
AbstractHydrateObject(ObjectContext ctx)
Each object is created belonging to an ObjectContext |
Method Summary | |
---|---|
abstract java.io.PrintStream |
dump(java.io.PrintStream out,
boolean title,
int depth,
int indent)
|
boolean |
equals(java.lang.Object o)
|
ObjectContext |
getContext()
|
abstract java.lang.Class |
getImplementedIfc()
Each business object concrete class implements a particular business object interface. |
boolean |
isChanged()
|
boolean |
isPersisted()
Determine if the object is persisted in the database. |
boolean |
isPreSaving()
|
boolean |
isRemoved()
Determine if a request has been made to remove the object from the database |
boolean |
isUpdating()
|
static java.lang.String |
makeIndent(int i)
Helper method to be used by implementations of dump to
indent the output to an appropriate level. |
void |
save(SaveContext ctx)
This method is called by users of this business object to persist it in a persistent store. |
void |
setClean()
Set the object to a 'clean' state. |
void |
setContext(ObjectContext ctx)
Set the object context associated with the object |
void |
setDirty()
Set the object to a 'dirty' state. |
void |
setNotPersisted()
Call this method to indicate that the object has not been persisted in a database. |
void |
setPersisted()
Call this method to indicate that the object has been persisted in a database. |
void |
setPostSaving()
Set the object to a state indicating that it is finishing the update process on an object |
void |
setPreSaving()
Set the object to a state indicating that it has been partially updated |
void |
setRemoved(boolean remove)
Mark this object as having been deleted from the database. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.hydrateframework.HydrateObject |
---|
attributeType, forget, getDiscriminator, getFamily, getKey, isFieldPopulated, mergeDown, save, setAttrFromString, writeAttributesXML |
Constructor Detail |
---|
public AbstractHydrateObject(ObjectContext ctx)
ObjectContext
ctx
- the context within which the object is being created. It
is legal for this parameter to be null, but much of the infrastructure
will not work if it is.Method Detail |
---|
public static java.lang.String makeIndent(int i)
dump
to
indent the output to an appropriate level.
public boolean isChanged()
isChanged
in interface HydrateObject
public boolean isUpdating()
isUpdating
in interface HydrateObject
public boolean isPreSaving()
isPreSaving
in interface HydrateObject
public void setPreSaving()
HydrateObject
setPreSaving
in interface HydrateObject
public void setPostSaving()
HydrateObject
setPostSaving
in interface HydrateObject
public void setClean()
HydrateObject
isChanged
will subsequently
return false unless the object is not in the database. isUpdating
will subsequently return false.
setClean
in interface HydrateObject
public void setDirty()
HydrateObject
isChanged
will subsequently
return true.
setDirty
in interface HydrateObject
public final void save(SaveContext ctx) throws SaveException
HydrateObject
save
in interface HydrateObject
SaveException
public void setPersisted()
HydrateObject
setPersisted
in interface HydrateObject
public void setNotPersisted()
HydrateObject
setNotPersisted
in interface HydrateObject
public void setRemoved(boolean remove)
HydrateObject
setRemoved
in interface HydrateObject
public boolean isRemoved()
HydrateObject
isRemoved
in interface HydrateObject
public boolean isPersisted()
HydrateObject
isPersisted
in interface HydrateObject
public ObjectContext getContext()
getContext
in interface HydrateObject
public void setContext(ObjectContext ctx)
HydrateObject
setContext
in interface HydrateObject
ctx
- the new contextpublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public abstract java.lang.Class getImplementedIfc()
HydrateObject
this.getKey().getKeyClass()
since the key class is always the base business class and this
method returns the actual interface that is being implemented.
getImplementedIfc
in interface HydrateObject
public abstract java.io.PrintStream dump(java.io.PrintStream out, boolean title, int depth, int indent)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |