org.openware.job.data
Class Persist

java.lang.Object
  |
  +--org.openware.job.data.Persist
All Implemented Interfaces:
java.io.Serializable

public abstract class Persist
extends java.lang.Object
implements java.io.Serializable

The abstract super class for all persistent objects. Every generated persistent object subclasses this abstract class.

Version:
$Revision: 1.10 $ $Date: 2001/04/06 01:38:02 $
Author:
Vincent Sheffer
See Also:
Serialized Form

Field Summary
protected  PersistentManager pmanager
           
protected  java.lang.String subclassName
           
 
Constructor Summary
protected Persist()
           
protected Persist(PersistentManager manager, boolean isSuperClass)
           
 
Method Summary
abstract  boolean equals(java.lang.Object obj)
          Determines whether 2 persist objects are the same.
abstract  java.lang.String getAsString(java.lang.String colname)
          Get the value for the field as a String type.
abstract  DataShell getDataShell()
          Get the underlying data shell object.
abstract  boolean getIsInvalid()
          Returns true if the persist object is invalid, false if it is valid.
abstract  Oid getOid()
          Get the object identifier for this object.
 PersistentManager getPersistentManager()
          Get the persistent manager that this persist object belongs to.
protected  void init(PersistentManager pmanager, TableRow data, Oid oid)
           
 void makeInvalid()
          Make the persist object invalid.
 void makeValid()
          Make the persist object valid.
abstract  boolean rawUpdate()
          Do a raw update on the persist object.
 void remove()
          Set the persist object for removal with the next call to PersistentManager.save().
abstract  void setAsString(java.lang.String colname, java.lang.String value)
          Set the value for the field.
abstract  void setRawUpdate(IRawUpdate update)
          Set the raw update method for this persist object.
 java.lang.String toHtmlPropName(java.lang.String propname)
           
abstract  void validate(java.lang.String colname)
          Call type specific validation for the column with the given name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

subclassName

protected java.lang.String subclassName

pmanager

protected PersistentManager pmanager
Constructor Detail

Persist

protected Persist()

Persist

protected Persist(PersistentManager manager,
                  boolean isSuperClass)
Method Detail

init

protected void init(PersistentManager pmanager,
                    TableRow data,
                    Oid oid)
             throws PersistException

makeInvalid

public void makeInvalid()
                 throws PersistException
Make the persist object invalid. This will prevent any changes to the object from being saved to the database.

NOTE: One possible "change" is creating a new object. In other words if you create a subclass of persist and then make it invalid it will not be saved to the database (by calling PersistentManager.save()) until you make it valid again with a call to makeValid


makeValid

public void makeValid()
               throws PersistException
Make the persist object valid. After you call this any changes to the object will be commited to the database on the next call to PersistentManager.save().

getIsInvalid

public abstract boolean getIsInvalid()
                              throws PersistException
Returns true if the persist object is invalid, false if it is valid.

validate

public abstract void validate(java.lang.String colname)
                       throws PersistException
Call type specific validation for the column with the given name. Because the underlying storage of each field is just a String it is possible that certain fields will contain invalid data, such as non numeric characters for some sort of number field.
Parameters:
colname - The name of the field to validate.
Throws:
PersistException - if the field is not valid.

getOid

public abstract Oid getOid()
Get the object identifier for this object. This name will consist of the table name and the primary key for the row.

getDataShell

public abstract DataShell getDataShell()
                                throws PersistException
Get the underlying data shell object.

Each persist object actually contains a shell that contains the data. Use this method to get that object.


getAsString

public abstract java.lang.String getAsString(java.lang.String colname)
                                      throws PersistException
Get the value for the field as a String type.

setAsString

public abstract void setAsString(java.lang.String colname,
                                 java.lang.String value)
                          throws PersistException
Set the value for the field. The value is a string and no validation is performed.

setRawUpdate

public abstract void setRawUpdate(IRawUpdate update)
                           throws PersistException
Set the raw update method for this persist object. Raw updates allow you to bypass the default behavior for database updates as specified in the database adaptor for your database.

rawUpdate

public abstract boolean rawUpdate()
                           throws PersistException
Do a raw update on the persist object. The persistent manager does nothing but call the raw update method in the EJB. If you want to change the state you will need to do this explicitly.
Returns:
true if the persist was updated, false otherwise.

equals

public abstract boolean equals(java.lang.Object obj)
Determines whether 2 persist objects are the same.
Overrides:
equals in class java.lang.Object

remove

public void remove()
            throws PersistException
Set the persist object for removal with the next call to PersistentManager.save().

getPersistentManager

public PersistentManager getPersistentManager()
Get the persistent manager that this persist object belongs to.

toHtmlPropName

public java.lang.String toHtmlPropName(java.lang.String propname)


Copyright © 2000,2001 Openware. All Rights Reserved.