com.objectwave.persist.examples
Class InvertEmployeePersistenceBase

java.lang.Object
  |
  +--com.objectwave.persist.examples.InvertEmployee
        |
        +--com.objectwave.persist.examples.InvertEmployeePersistenceBase
All Implemented Interfaces:
Persistence, java.io.Serializable, TransactionalObjectIF
Direct Known Subclasses:
InvertEmployeePersistence

public class InvertEmployeePersistenceBase
extends InvertEmployee
implements Persistence

See Also:
Serialized Form

Field Summary
 RDBPersistentAdapter adapt
           
 ObjectEditingView editor
           
 java.lang.Integer objectIdentifier
           
 
Constructor Summary
InvertEmployeePersistenceBase()
           
 
Method Summary
protected  void addDefaultPrimaryAttribute(java.util.ArrayList list)
          Add primary attribute type with a column name of databaseIdentifer.
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.
protected  java.util.Vector getClassDescriptor()
           
 ObjectEditingView getObjectEditor()
          Gets the ObjectEditor attribute of the DomainObject object
 java.lang.Integer getObjectIdentifier()
          Gets the ObjectIdentifier attribute of the DomainObject object
 java.lang.Object getPrimaryKeyField()
          Gets the PrimaryKeyField attribute of the DomainObject object
 java.lang.Object[] getPrimaryKeyFields()
          Gets the PrimaryKeyField attributes of the DomainObject object
protected  java.lang.String getTableName()
           
protected  XMLDecoder getXmlDefinition(java.lang.String xmlTag, java.lang.Object obj)
          Create the XMLDecoder object that will allow the creation of all of the map information.
protected  void initDescriptor(java.lang.String xmlTag, Persistence obj, RDBPersistentAdapter adapter)
          Read in the XML file and populate the persistent map information.
 ObjectEditingView initializeObjectEditor(java.lang.String xmlTag)
          Called to initialize object editor It will use an XML file for the field match.
 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
protected  java.lang.String locateXmlMap(java.lang.String xmlTag, java.lang.Object persistentObject)
          Find the XML document that contains the persitent map information.
 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.
protected  void setClassDescriptor(java.util.Vector v)
           
 void setObjectEditor(ObjectEditingView e)
          For an RDBPersistent system, this will be an RDBPersistentAdapter.
 void setObjectIdentifier(java.lang.Integer aValue)
          Sets the ObjectIdentifier attribute of the DomainObject object
 void setPrimaryKeyField(java.lang.Object obj)
          Sets the PrimaryKeyField attribute of the DomainObject object
 void setPrintString(java.lang.String value)
          A user friendly description.
 void setRetrievedFromDatabase(boolean b)
          Sets the RetrievedFromDatabase attribute of the DomainObject object
protected  void setTableName(java.lang.String table)
           
protected  void setup()
          Override this method if you wish to setup your object differently.
 java.lang.String toString()
           
 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 com.objectwave.persist.examples.InvertEmployee
generateId, getEmployeeId, getPerson, setEmployeeId, setInvertPerson
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

objectIdentifier

public java.lang.Integer objectIdentifier

editor

public transient ObjectEditingView editor

adapt

public transient RDBPersistentAdapter adapt
Constructor Detail

InvertEmployeePersistenceBase

public InvertEmployeePersistenceBase()
Method Detail

setup

protected void setup()
              throws java.lang.Exception
Override this method if you wish to setup your object differently. This should work if your Xml is found in the directory of the Persistent class and it has the same name as the persistent class.

java.lang.Exception

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

setObjectEditor

public void setObjectEditor(ObjectEditingView e)
For an RDBPersistent system, this will be an RDBPersistentAdapter.

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

setObjectIdentifier

public void setObjectIdentifier(java.lang.Integer aValue)
Sets the ObjectIdentifier attribute of the DomainObject object

Parameters:
aValue - The new ObjectIdentifier value

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

setPrintString

public void setPrintString(java.lang.String value)
A user friendly description.

Parameters:
value - The new PrintString value

setRetrievedFromDatabase

public void setRetrievedFromDatabase(boolean b)
Sets the RetrievedFromDatabase attribute of the DomainObject object

Specified by:
setRetrievedFromDatabase in interface Persistence
Parameters:
b - The new RetrievedFromDatabase 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

getObjectIdentifier

public java.lang.Integer getObjectIdentifier()
Gets the ObjectIdentifier attribute of the DomainObject object

Returns:
The ObjectIdentifier 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 PrimaryKeyField attributes of the DomainObject object

Specified by:
getPrimaryKeyFields in interface Persistence
Returns:
The PrimaryKeyField 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

initializeObjectEditor

public ObjectEditingView initializeObjectEditor(java.lang.String xmlTag)
                                         throws java.io.FileNotFoundException,
                                                ConfigurationException
Called to initialize object editor It will use an XML file for the field match. This method is only used when using XML files to define your persistent map information. The xmlTag parameter can be either the name of an XML file or a key to System properties to a value of an XML file name.

Parameters:
xmlTag - String The tag name in the initial file
Returns:
Throws:
java.io.FileNotFoundException
ConfigurationException
See Also:
locateXmlMap(java.lang.String, java.lang.Object)

initDescriptor

protected void initDescriptor(java.lang.String xmlTag,
                              Persistence obj,
                              RDBPersistentAdapter adapter)
                       throws java.io.FileNotFoundException,
                              ConfigurationException
Read in the XML file and populate the persistent map information. Use initializeObjectEditor instead of this method.

Parameters:
xmlTag -
obj -
adapter -
Throws:
java.io.FileNotFoundException
ConfigurationException

delete

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

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

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:

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:

setTableName

protected void setTableName(java.lang.String table)

setClassDescriptor

protected void setClassDescriptor(java.util.Vector v)

getTableName

protected java.lang.String getTableName()

getClassDescriptor

protected java.util.Vector getClassDescriptor()

getXmlDefinition

protected XMLDecoder getXmlDefinition(java.lang.String xmlTag,
                                      java.lang.Object obj)
                               throws java.io.FileNotFoundException,
                                      ConfigurationException
Create the XMLDecoder object that will allow the creation of all of the map information.

Parameters:
xmlTag -
obj -
Returns:
The XmlDefinition value
Throws:
java.io.FileNotFoundException
ConfigurationException

addDefaultPrimaryAttribute

protected void addDefaultPrimaryAttribute(java.util.ArrayList list)
Add primary attribute type with a column name of databaseIdentifer. This is the default primary key field. The map may define its own primary key field, in which case the default will not be added.

Parameters:
list - ArrayList The list that was found in the Xml map

createAdapter

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

Parameters:
persistentObject -
Returns:

locateXmlMap

protected java.lang.String locateXmlMap(java.lang.String xmlTag,
                                        java.lang.Object persistentObject)
                                 throws ConfigurationException,
                                        java.io.FileNotFoundException
Find the XML document that contains the persitent map information. First decide if the xmlTag is really a key in system properties identifying the actual file name. If a key is not found, the xmlTag is assumed to be the xml file name. Once the name is determined, locate the XML file. First look in same directory as the persisent object class file.

Parameters:
xmlTag - String The tag name for the xml resource.
persistentObject -
Returns:
Throws:
ConfigurationException
java.io.FileNotFoundException