com.objectwave.persist.xml
Class TestXMLPerson

java.lang.Object
  |
  +--com.objectwave.persist.examples.DomainObject
        |
        +--com.objectwave.persist.xml.TestXMLPerson
All Implemented Interfaces:
Persistence, java.io.Serializable, TransactionalObjectIF

public class TestXMLPerson
extends DomainObject

A sample for using a XML file to read match field

Version:
$Id: TestXMLPerson.java,v 2.4 2002/03/23 13:42:11 dave_hoag Exp $
Author:
Zhou Cai
See Also:
Serialized Form

Nested Class Summary
static class TestXMLPerson.Test
           
 
Nested classes inherited from class com.objectwave.persist.examples.DomainObject
DomainObject.Test
 
Field Summary
static java.lang.reflect.Field _annualIncome
           
static java.lang.reflect.Field _company
           
static java.lang.reflect.Field _fax
           
static java.lang.reflect.Field _founderOf
           
static java.lang.reflect.Field _name
           
static java.lang.reflect.Field _phone
           
static java.lang.reflect.Field _title
           
 
Fields inherited from class com.objectwave.persist.examples.DomainObject
adapt, editor, objectIdentifier, tableMap
 
Constructor Summary
TestXMLPerson()
          Using this method to do the field match with xml file tag note: "table.testPerson" in method means tha tag name for XML file which include all the field match info.
 
Method Summary
 double getAnnualIncome()
          Gets the AnnualIncome attribute of the TestXMLPerson object
protected  java.util.Vector getClassDescriptor()
          Use an instance method to access a static variable.
 TestXMLCompany getCompany()
          Gets the Company attribute of the TestXMLPerson object
 java.lang.String getFax()
          Gets the Fax attribute of the TestXMLPerson object
 TestXMLCompany getFounderOf()
          Gets the FounderOf attribute of the TestXMLPerson object
 java.lang.String getName()
          Gets the Name attribute of the TestXMLPerson object
 java.lang.String getPhone()
          Gets the Phone attribute of the TestXMLPerson object
protected  java.lang.String getTableName()
          Use an instance method to access a static variable.
 java.lang.String getTitle()
          Gets the Title attribute of the TestXMLPerson object
 void setAnnualIncome(double aValue)
          Sets the AnnualIncome attribute of the TestXMLPerson object
protected  void setClassDescriptor(java.util.Vector v)
          Use an instance method to access a static variable.
 void setCompany(TestXMLCompany aValue)
          Sets the Company attribute of the TestXMLPerson object
 void setFax(java.lang.String aValue)
          Sets the Fax attribute of the TestXMLPerson object
 void setFounderOf(TestXMLCompany aValue)
          Sets the FounderOf attribute of the TestXMLPerson object
 void setName(java.lang.String aValue)
          Sets the Name attribute of the TestXMLPerson object
 void setPhone(java.lang.String aValue)
          Sets the Phone attribute of the TestXMLPerson object
protected  void setTableName(java.lang.String table)
          Use an instance method to access a static variable.
 void setTitle(java.lang.String aValue)
          Sets the Title attribute of the TestXMLPerson object
 
Methods inherited from class com.objectwave.persist.examples.DomainObject
addDefaultPrimaryAttribute, createAdapter, delete, getAdapter, getBrokerName, getEntry, getObjectEditor, getObjectIdentifier, getPrimaryKeyField, getPrimaryKeyFields, getSuperDescriptor, getXmlDefinition, initDescription, initDescriptor, initializeObjectEditor, initializeObjectEditor, insert, isDirty, isRetrievedFromDatabase, isTransient, locateXmlMap, lock, markForDelete, save, setAsTransient, setBrokerName, setEntry, setObjectEditor, setObjectIdentifier, setPrimaryKeyField, setPrintString, setRetrievedFromDatabase, toString, unlock, update, usesAdapter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

public static java.lang.reflect.Field _name

_phone

public static java.lang.reflect.Field _phone

_fax

public static java.lang.reflect.Field _fax

_title

public static java.lang.reflect.Field _title

_annualIncome

public static java.lang.reflect.Field _annualIncome

_company

public static java.lang.reflect.Field _company

_founderOf

public static java.lang.reflect.Field _founderOf
Constructor Detail

TestXMLPerson

public TestXMLPerson()
              throws java.io.FileNotFoundException,
                     ConfigurationException
Using this method to do the field match with xml file tag note: "table.testPerson" in method means tha tag name for XML file which include all the field match info. There are two acceptable parameters for the initializeObjectEditor string value. One is a key that gets mapped to system properties to an XML file, or the just the actual name of the xml file. See the constructor of TestXMLCompany for a comparison.

Throws:
java.io.FileNotFoundException
ConfigurationException
Method Detail

setCompany

public void setCompany(TestXMLCompany aValue)
Sets the Company attribute of the TestXMLPerson object

Parameters:
aValue - The new Company value

setFounderOf

public void setFounderOf(TestXMLCompany aValue)
Sets the FounderOf attribute of the TestXMLPerson object

Parameters:
aValue - The new FounderOf value

setAnnualIncome

public void setAnnualIncome(double aValue)
Sets the AnnualIncome attribute of the TestXMLPerson object

Parameters:
aValue - The new AnnualIncome value

setFax

public void setFax(java.lang.String aValue)
Sets the Fax attribute of the TestXMLPerson object

Parameters:
aValue - The new Fax value

setName

public void setName(java.lang.String aValue)
Sets the Name attribute of the TestXMLPerson object

Parameters:
aValue - The new Name value

setPhone

public void setPhone(java.lang.String aValue)
Sets the Phone attribute of the TestXMLPerson object

Parameters:
aValue - The new Phone value

setTitle

public void setTitle(java.lang.String aValue)
Sets the Title attribute of the TestXMLPerson object

Parameters:
aValue - The new Title value

getAnnualIncome

public double getAnnualIncome()
Gets the AnnualIncome attribute of the TestXMLPerson object

Returns:
The AnnualIncome value

getFax

public java.lang.String getFax()
Gets the Fax attribute of the TestXMLPerson object

Returns:
The Fax value

getName

public java.lang.String getName()
Gets the Name attribute of the TestXMLPerson object

Returns:
The Name value

getPhone

public java.lang.String getPhone()
Gets the Phone attribute of the TestXMLPerson object

Returns:
The Phone value

getTitle

public java.lang.String getTitle()
Gets the Title attribute of the TestXMLPerson object

Returns:
The Title value

getCompany

public TestXMLCompany getCompany()
Gets the Company attribute of the TestXMLPerson object

Returns:
The Company value

getFounderOf

public TestXMLCompany getFounderOf()
Gets the FounderOf attribute of the TestXMLPerson object

Returns:
The FounderOf value

setTableName

protected void setTableName(java.lang.String table)
Use an instance method to access a static variable. This method MUST be duplicated in each and every subclass. This allows our generic logic in this super class to modify static state in a subclass.

Overrides:
setTableName in class DomainObject
Parameters:
table - The new TableName value

setClassDescriptor

protected void setClassDescriptor(java.util.Vector v)
Use an instance method to access a static variable. This method MUST be duplicated in each and every subclass. This allows our generic logic in this super class to modify static state in a subclass.

Overrides:
setClassDescriptor in class DomainObject
Parameters:
v - The new ClassDescriptor value

getTableName

protected java.lang.String getTableName()
Use an instance method to access a static variable. This method MUST be duplicated in each and every subclass. This allows our generic logic in this super class to modify static state in a subclass.

Overrides:
getTableName in class DomainObject
Returns:
The TableName value

getClassDescriptor

protected java.util.Vector getClassDescriptor()
Use an instance method to access a static variable. This method MUST be duplicated in each and every subclass. This allows our generic logic in this super class to modify static state in a subclass.

Overrides:
getClassDescriptor in class DomainObject
Returns:
The ClassDescriptor value