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 >
-
PersistentObject()
- Default constructor.
-
PersistentObject(DatastoreJDBC)
- This constructor creates a persistent object with an associated datastore.
-
_executeAction(String, Object[])
-
-
_handleException(Exception)
-
-
addPOCompleteListener(POCompleteListener)
- Use this method to register a listener for method complete events.
-
addPropertyChangeListener(PropertyChangeListener)
-
-
cancel()
- This method cancels the SQL statement currently running on a
background thread.
-
clone()
- This method allows a class that implements PersistentObject to use the
clone method.
-
getAttributes()
-
-
getAttributeStrings()
-
-
getCurrentDatastore()
- Implemented in subclass wich is generated by Data Access Builder.
-
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.
-
getObjectsDatastore()
- This method returns the datastore object associated with the current
object, or null if one has not been associated with the object.
-
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).
-
isAsynchronous()
- This method tells you whether methods are set to run on a background
thread or not.
-
isBusy()
- This method tells you whether the object is running a method in the
background.
-
isModified()
- Use this method to determine whether any of the current PersistentObject's
properties has been changed.
-
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.
-
removePOCompleteListener(POCompleteListener)
- Use this method to remove the method complete listener on the PersistentObject.
-
removePropertyChangeListener(PropertyChangeListener)
-
-
setAsynchronous(boolean)
- This method lets you set whether the database methods are run on a
background thread.
-
setModified(boolean)
- Use this method to change the isModified setting.
-
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.
-
setObjectsDatastore(DatastoreJDBC)
- This method lets you associate a datastore object with the current
persistent object.
-
toString()
- This method returns a string made up of the object's attributes.
-
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.
PersistentObject
public PersistentObject()
- Default constructor.
PersistentObject
public PersistentObject(DatastoreJDBC ods)
- This constructor creates a persistent object with an associated datastore.
- Parameters:
- ods - - a datastore object.
_executeAction
public abstract void _executeAction(String action,
Object params[]) throws Exception
_handleException
public void _handleException(Exception ex)
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.
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
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.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
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.
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.
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.
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.
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
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.
getAttributes
public abstract Object[] getAttributes()
getAttributeStrings
public abstract String[] getAttributeStrings()
All Packages Class Hierarchy This Package Previous Next Index