com.objectwave.persist.xml
Class TestXMLCompany

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

public class TestXMLCompany
extends DomainObject

A sample for using a XML file to read match field. This implementation is showing the absolute minimal amount of information that could is required in a persistent object.

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

Nested Class Summary
static class TestXMLCompany.Test
          Unit Test
 
Nested classes inherited from class com.objectwave.persist.examples.DomainObject
DomainObject.Test
 
Field Summary
static java.lang.reflect.Field _address
           
static java.lang.reflect.Field _employees
           
static java.lang.reflect.Field _founders
           
static java.lang.reflect.Field _name
           
protected  java.lang.String address
           
protected  java.util.Vector employees
           
protected  java.util.Vector founders
           
protected  java.lang.String name
           
 
Fields inherited from class com.objectwave.persist.examples.DomainObject
adapt, editor, objectIdentifier, tableMap
 
Constructor Summary
TestXMLCompany()
          Using this method to do the field match with xml file called testCompany.xml.
 
Method Summary
 java.lang.String getAddress()
          Gets the Address attribute of the TestXMLCompany object
protected  java.util.Vector getClassDescriptor()
          Use an instance method to access a static variable.
 java.util.Vector getEmployees()
          Gets the Employees attribute of the TestXMLCompany object
 java.util.Vector getFounders()
          Gets the Founders attribute of the TestXMLCompany object
 java.lang.String getName()
          Gets the Name attribute of the TestXMLCompany object
protected  java.lang.String getTableName()
          Use an instance method to access a static variable.
 void setAddress(java.lang.String aValue)
          Sets the Address attribute of the TestXMLCompany object
protected  void setClassDescriptor(java.util.Vector v)
          Use an instance method to access a static variable.
 void setEmployees(java.util.Vector aValue)
          Sets the Employees attribute of the TestXMLCompany object
 void setFounders(java.util.Vector aValue)
          Sets the Founders attribute of the TestXMLCompany object
 void setName(java.lang.String aValue)
          Sets the Name attribute of the TestXMLCompany object
protected  void setTableName(java.lang.String table)
          Use an instance method to access a static variable.
 
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

_address

public static java.lang.reflect.Field _address

_employees

public static java.lang.reflect.Field _employees

_founders

public static java.lang.reflect.Field _founders

name

protected java.lang.String name

address

protected java.lang.String address

employees

protected java.util.Vector employees

founders

protected java.util.Vector founders
Constructor Detail

TestXMLCompany

public TestXMLCompany()
               throws java.io.FileNotFoundException,
                      ConfigurationException
Using this method to do the field match with xml file called testCompany.xml. There are two possible parameters for the initializeObjectEditor method. The first is the actual xml file name. This file will be located within the same directory of the persisent class definition. The second could be a key to System properties that identifies the name of an XML file to use.

Throws:
java.io.FileNotFoundException - The specified file could not be located
ConfigurationException - Some other problem related to the configuration occured
Method Detail

setEmployees

public void setEmployees(java.util.Vector aValue)
Sets the Employees attribute of the TestXMLCompany object

Parameters:
aValue - The new Employees value

setFounders

public void setFounders(java.util.Vector aValue)
Sets the Founders attribute of the TestXMLCompany object

Parameters:
aValue - The new Founders value

setName

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

Parameters:
aValue - The new Name value

setAddress

public void setAddress(java.lang.String aValue)
Sets the Address attribute of the TestXMLCompany object

Parameters:
aValue - The new Address value

getEmployees

public java.util.Vector getEmployees()
Gets the Employees attribute of the TestXMLCompany object

Returns:
The Employees value

getFounders

public java.util.Vector getFounders()
Gets the Founders attribute of the TestXMLCompany object

Returns:
The Founders value

getName

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

Returns:
The Name value

getAddress

public java.lang.String getAddress()
Gets the Address attribute of the TestXMLCompany object

Returns:
The Address 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

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

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