com.objectwave.transactionalSupport.test
Class DomainObject

java.lang.Object
  |
  +--com.objectwave.transactionalSupport.test.DomainObject
All Implemented Interfaces:
Persistence, java.io.Serializable, TransactionalObjectIF
Direct Known Subclasses:
TestEntity

public abstract class DomainObject
extends java.lang.Object
implements Persistence

A possible root Business object for an application.

Version:
$Id: DomainObject.java,v 1.1 2001/10/03 14:59:03 dave_hoag Exp $
Author:
dhoag
See Also:
Serialized Form

Field Summary
 RDBPersistentAdapter adapt
           
 ObjectEditingView editor
           
 
Constructor Summary
DomainObject()
           
 
Method Summary
protected  RDBPersistentAdapter createAdapter(Persistence persistentObject)
          Create the new ObjectEditingView instance that is to be our 'adapter' to the persistent object.
 void delete()
           
 Persistence getAdapter()
          Gets the Adapter attribute of the DomainObject object
 java.lang.String getBrokerName()
          Support for individual instances residing in their own brokers.
 ObjectEditingView getObjectEditor()
          Gets the ObjectEditor attribute of the DomainObject object
 java.lang.Object getPrimaryKeyField()
          Gets the PrimaryKeyField attribute of the DomainObject object
 java.lang.Object[] getPrimaryKeyFields()
          Gets the PrimaryKeyFields attribute of the DomainObject object
abstract  java.lang.String getTableName()
          Gets the TableName attribute of the DomainObject object
abstract  java.util.Vector initDescriptor()
           
 void insert()
          Force this object to be a part of the changedObjects list.
 boolean isDirty()
          Gets the Dirty attribute of the DomainObject object
 boolean isRetrievedFromDatabase()
          Gets the RetrievedFromDatabase attribute of the DomainObject object
 boolean isTransient()
          Gets the Transient attribute of the DomainObject object
 boolean lock(boolean wait)
          This method was created in VisualAge.
 void markForDelete()
          Mark this object to be deleted in this transaction.
 void save()
           
 void setAsTransient(boolean value)
          Sets the AsTransient attribute of the DomainObject object
 void setBrokerName(java.lang.String aValue)
          Support for individual instances residing in their own brokers.
 void setObjectEditor(ObjectEditingView view)
          Subclasses will override this method to return an appropriate instance of a RDBPersistentAdapter; This method will always instantiate the inner adapter found in DomainObject's class definition.
 void setPrimaryKeyField(java.lang.Object obj)
          Sets the PrimaryKeyField attribute of the DomainObject object
 void setRetrievedFromDatabase(boolean b)
          Sets the ObjectIdentifier attribute of the DomainObject object public void setObjectIdentifier(Integer aValue) { editor.set(_objectIdentifier, aValue, objectIdentifier); } Sets the PrimaryKeyField attribute of the DomainObject object public void setPrimaryKeyField(Object obj) { getAdapter().setPrimaryKeyField(obj); } Sets the RetrievedFromDatabase attribute of the DomainObject object
 void unlock()
          This method was created in VisualAge.
 void update(boolean get, java.lang.Object[] data, java.lang.reflect.Field[] fields)
          Method no longer does anything since setAccessible solves our need for this behavior.
 boolean usesAdapter()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

editor

public transient ObjectEditingView editor

adapt

public transient RDBPersistentAdapter adapt
Constructor Detail

DomainObject

public DomainObject()
Method Detail

setPrimaryKeyField

public void setPrimaryKeyField(java.lang.Object obj)
Sets the PrimaryKeyField attribute of the DomainObject object

Specified by:
setPrimaryKeyField in interface Persistence
Parameters:
obj - The new PrimaryKeyField value

setBrokerName

public void setBrokerName(java.lang.String aValue)
Support for individual instances residing in their own brokers.

Specified by:
setBrokerName in interface Persistence
Parameters:
aValue - The new BrokerName value

setAsTransient

public void setAsTransient(boolean value)
Sets the AsTransient attribute of the DomainObject object

Specified by:
setAsTransient in interface TransactionalObjectIF
Parameters:
value - The new AsTransient value

setRetrievedFromDatabase

public void setRetrievedFromDatabase(boolean b)
Sets the ObjectIdentifier attribute of the DomainObject object public void setObjectIdentifier(Integer aValue) { editor.set(_objectIdentifier, aValue, objectIdentifier); } Sets the PrimaryKeyField attribute of the DomainObject object public void setPrimaryKeyField(Object obj) { getAdapter().setPrimaryKeyField(obj); } Sets the RetrievedFromDatabase attribute of the DomainObject object

Specified by:
setRetrievedFromDatabase in interface Persistence
Parameters:
b - The new RetrievedFromDatabase value

setObjectEditor

public void setObjectEditor(ObjectEditingView view)
Subclasses will override this method to return an appropriate instance of a RDBPersistentAdapter; This method will always instantiate the inner adapter found in DomainObject's class definition. There are two approaches to this method the first of which is to create your own subclass of RDBPersistentAdapter and return it as a result from this method. The second, is to tweak the instance created by this method by setting table name and the description.

Specified by:
setObjectEditor in interface TransactionalObjectIF
Parameters:
view - The new ObjectEditor value

getAdapter

public Persistence getAdapter()
Gets the Adapter attribute of the DomainObject object

Specified by:
getAdapter in interface Persistence
Returns:
The Adapter value

getBrokerName

public java.lang.String getBrokerName()
Support for individual instances residing in their own brokers.

Specified by:
getBrokerName in interface Persistence
Returns:
The BrokerName value

getObjectEditor

public ObjectEditingView getObjectEditor()
Gets the ObjectEditor attribute of the DomainObject object

Specified by:
getObjectEditor in interface TransactionalObjectIF
Returns:
The ObjectEditor value

getPrimaryKeyField

public java.lang.Object getPrimaryKeyField()
Gets the PrimaryKeyField attribute of the DomainObject object

Specified by:
getPrimaryKeyField in interface Persistence
Returns:
The PrimaryKeyField value

getPrimaryKeyFields

public java.lang.Object[] getPrimaryKeyFields()
Gets the PrimaryKeyFields attribute of the DomainObject object

Specified by:
getPrimaryKeyFields in interface Persistence
Returns:
The PrimaryKeyFields value

isDirty

public boolean isDirty()
Gets the Dirty attribute of the DomainObject object

Specified by:
isDirty in interface TransactionalObjectIF
Returns:
The Dirty value

isRetrievedFromDatabase

public boolean isRetrievedFromDatabase()
Gets the RetrievedFromDatabase attribute of the DomainObject object

Specified by:
isRetrievedFromDatabase in interface Persistence
Returns:
The RetrievedFromDatabase value

isTransient

public boolean isTransient()
Gets the Transient attribute of the DomainObject object

Specified by:
isTransient in interface TransactionalObjectIF
Returns:
The Transient value

getTableName

public abstract java.lang.String getTableName()
Gets the TableName attribute of the DomainObject object

Returns:
The TableName value

delete

public void delete()
            throws QueryException
Specified by:
delete in interface Persistence
Throws:
QueryException

initDescriptor

public abstract java.util.Vector initDescriptor()
Returns:

insert

public void insert()
            throws QueryException
Description copied from interface: Persistence
Force this object to be a part of the changedObjects list.

Specified by:
insert in interface Persistence
Throws:
QueryException

lock

public boolean lock(boolean wait)
This method was created in VisualAge.

Specified by:
lock in interface Persistence
Parameters:
wait - boolean
Returns:
boolean

markForDelete

public void markForDelete()
                   throws QueryException
Mark this object to be deleted in this transaction. If a transaction is not in progress, this object will be deleted immediately.

Throws:
QueryException

save

public void save()
          throws QueryException
Specified by:
save in interface Persistence
Throws:
QueryException

unlock

public void unlock()
This method was created in VisualAge.

Specified by:
unlock in interface Persistence

update

public void update(boolean get,
                   java.lang.Object[] data,
                   java.lang.reflect.Field[] fields)
Method no longer does anything since setAccessible solves our need for this behavior.

Specified by:
update in interface TransactionalObjectIF
Parameters:
get -
data -
fields -

usesAdapter

public boolean usesAdapter()
Specified by:
usesAdapter in interface Persistence
Returns:

createAdapter

protected RDBPersistentAdapter createAdapter(Persistence persistentObject)
Create the new ObjectEditingView instance that is to be our 'adapter' to the persistent object.

Parameters:
persistentObject -
Returns: