All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JProjects.eab.data.PersistentObject

java.lang.Object
   |
   +----JProjects.eab.data.PersistentObject

public abstract class PersistentObject
extends Object
implements Cloneable, Serializable, OnThreadActionExecutor, DataAccessObject

This abstract class defines the standard interface for data access classes. It provides interfaces for adding, deleting, retrieving, and updating a row from a table. The Data Access Builder generates classes that implement this class.

Author:
Alexander Jaremenko
< jarem@isb.gomel.by >

Constructor Index

 o PersistentObject()
Default constructor.
 o PersistentObject(DatastoreJDBC)
This constructor creates a persistent object with an associated datastore.

Method Index

 o _executeAction(String, Object[])
 o _handleException(Exception)
 o addPOCompleteListener(POCompleteListener)
Use this method to register a listener for method complete events.
 o addPropertyChangeListener(PropertyChangeListener)
 o cancel()
This method cancels the SQL statement currently running on a background thread.
 o clone()
This method allows a class that implements PersistentObject to use the clone method.
 o getAttributes()
 o getAttributeStrings()
 o getCurrentDatastore()
Implemented in subclass wich is generated by Data Access Builder.
 o getObjectDataId()
This method, will be overridden in a subclass (such as <class> , which is generated by Data Access Builder) to return the DataId if the current object has a DataId.
 o getObjectsDatastore()
This method returns the datastore object associated with the current object, or null if one has not been associated with the object.
 o hasDataId()
This method will be overridden in a subclass (such as <class> , which is generated by Data Access Builder) if the current object has a DataID (and is therefore retrievable).
 o isAsynchronous()
This method tells you whether methods are set to run on a background thread or not.
 o isBusy()
This method tells you whether the object is running a method in the background.
 o isModified()
Use this method to determine whether any of the current PersistentObject's properties has been changed.
 o isReadOnly()
This method, when implemented in a subclass (such as <class> , which is generated by Data Access Builder), will tell you whether the current object's class is read-only or not.
 o removePOCompleteListener(POCompleteListener)
Use this method to remove the method complete listener on the PersistentObject.
 o removePropertyChangeListener(PropertyChangeListener)
 o setAsynchronous(boolean)
This method lets you set whether the database methods are run on a background thread.
 o setModified(boolean)
Use this method to change the isModified setting.
 o setObjectDataId(PODataId)
This method will be overridden in a subclass (such as <class>, which generated by Data Access Builder) to set the DataId if the current object has a DataId.
 o setObjectsDatastore(DatastoreJDBC)
This method lets you associate a datastore object with the current persistent object.
 o toString()
This method returns a string made up of the object's attributes.
 o toString(String)
This method, when implemented in a subclass (such as <class>, which is generated by Data Access Builder), returns a string made up of the object's attributes.

Constructors

 o PersistentObject
 public PersistentObject()
Default constructor.

 o PersistentObject
 public PersistentObject(DatastoreJDBC ods)
This constructor creates a persistent object with an associated datastore.

Parameters:
ods - - a datastore object.

Methods

 o _executeAction
 public abstract void _executeAction(String action,
                                     Object params[]) throws Exception
 o _handleException
 public void _handleException(Exception ex)
 o addPOCompleteListener
 public void addPOCompleteListener(POCompleteListener l)
Use this method to register a listener for method complete events.

Parameters:
l - - a POCompleteListener to listen for method complete events.
 o addPropertyChangeListener
 public void addPropertyChangeListener(PropertyChangeListener l)
 o cancel
 public void cancel() throws DAException
This method cancels the SQL statement currently running on a background thread.

Throws: DAException
with message ID CANCEL_FAILED if it is unable to cancel the statement.
 o clone
 public abstract Object clone()
This method allows a class that implements PersistentObject to use the clone method.

Returns:
an Object with the same attibute values as the current PersistentObject.
Overrides:
clone in class Object
 o getCurrentDatastore
 public abstract DatastoreJDBC getCurrentDatastore()
Implemented in subclass wich is generated by Data Access Builder. Returns the datastore object associated with the current object, unless it is null. If the object's datastore is null, it returns the class datastore, unless that is also null, in which case it returns the application datastore (which may be null).

Returns:
DatastoreJDBC object associated with the current object.
 o getObjectDataId
 public PODataId getObjectDataId()
This method, will be overridden in a subclass (such as <class> , which is generated by Data Access Builder) to return the DataId if the current object has a DataId.

Returns:
the objects PODataId if it has an associated DataId, or null if it does not.
 o getObjectsDatastore
 public DatastoreJDBC getObjectsDatastore()
This method returns the datastore object associated with the current object, or null if one has not been associated with the object.

Returns:
DatastoreJDBC object associated with the current object.
 o hasDataId
 public boolean hasDataId()
This method will be overridden in a subclass (such as <class> , which is generated by Data Access Builder) if the current object has a DataID (and is therefore retrievable).

Returns:
a boolean value of true if the current object has an associated DataId, or false if it does not.
 o isAsynchronous
 public boolean isAsynchronous()
This method tells you whether methods are set to run on a background thread or not. By default, this setting is off.

Returns:
boolean value of true if background thread support is turned on, or false if it is not.
 o isBusy
 public boolean isBusy()
This method tells you whether the object is running a method in the background.

Returns:
boolean value of true if the object is currently running a method on a background thread, or false if it is not.
 o isModified
 public boolean isModified()
Use this method to determine whether any of the current PersistentObject's properties has been changed.

Returns:
boolean value of true if at least one of the properties has changed, or false if none has changed.
 o isReadOnly
 public abstract boolean isReadOnly()
This method, when implemented in a subclass (such as <class> , which is generated by Data Access Builder), will tell you whether the current object's class is read-only or not.

Returns:
a boolean value of true if the current object is read-only, or false if it is not.
 o removePOCompleteListener
 public void removePOCompleteListener(POCompleteListener l)
Use this method to remove the method complete listener on the PersistentObject.

Parameters:
l - - the POCompleteListener you wish to remove.
 o removePropertyChangeListener
 public void removePropertyChangeListener(PropertyChangeListener l)
 o setAsynchronous
 public void setAsynchronous(boolean af)
This method lets you set whether the database methods are run on a background thread. By default, this background thread support is turned off.

Parameters:
af - - a boolean value of true to run methods on background thread, or false to turn background thread off.
 o setModified
 public void setModified(boolean mf)
Use this method to change the isModified setting.

Parameters:
mf - - a boolean value indicating whether an attribute from the current PersistentObject has been modified: true if at least one has been modified, or false if none has.
 o setObjectDataId
 public void setObjectDataId(PODataId di) throws DAException
This method will be overridden in a subclass (such as <class>, which generated by Data Access Builder) to set the DataId if the current object has a DataId.

Parameters:
di - - new PODataId object for this one.
 o setObjectsDatastore
 public void setObjectsDatastore(DatastoreJDBC obDs)
This method lets you associate a datastore object with the current persistent object. If you want the object to be associated with no datastore, pass in null.

Parameters:
obDs - - - the DatastoreJDBC object you want to associate with the current object.
 o toString
 public String toString()
This method returns a string made up of the object's attributes. Simply calls toString(".").

Returns:
a String containing the attributes.
Overrides:
toString in class Object
 o toString
 public abstract String toString(String delim)
This method, when implemented in a subclass (such as <class>, which is generated by Data Access Builder), returns a string made up of the object's attributes.

Parameters:
delim - - a string used to separate the toString representation of each attribute.
Returns:
a String containing the attributes.
 o getAttributes
 public abstract Object[] getAttributes()
 o getAttributeStrings
 public abstract String[] getAttributeStrings()

All Packages  Class Hierarchy  This Package  Previous  Next  Index