com.ashridgetech.prevdb.test
Class TestClassA

java.lang.Object
  |
  +--com.ashridgetech.prevdb.client.AbstractPersistentObject
        |
        +--com.ashridgetech.prevdb.test.TestClassA
All Implemented Interfaces:
Persistent

public class TestClassA
extends AbstractPersistentObject

Persistent test class for use in unit tests.


Field Summary
static PersistentField B
           
static PersistentField BALANCE
           
static PersistentField CREDIT_LIMIT
           
static PersistentField NAME
           
protected static PersistentField[] PERSISTENT_FIELDS
           
static PersistentField START_DATE
           
 
Fields inherited from class com.ashridgetech.prevdb.client.AbstractPersistentObject
oid, OID
 
Constructor Summary
TestClassA(PrevDb prevDb)
           
TestClassA(PrevDb prevDb, String name, Date startDate, int creditLimit, BigDecimal balance)
           
 
Method Summary
 TestClassB getB()
          Get the B
 BigDecimal getBalance()
          Get the cash balance
 int getCreditLimit()
          Get the credit limit
protected  Object getJavaField(Field javaField)
          Get the value of a Java field.
 String getName()
          Get the name
protected  PersistentField[] getPersistentFields()
          Provide an array of PersistentFields for this object.
 Date getStartDate()
          Get the starting date
 void setB(TestClassB b)
          Set the B
 void setCreditLimit(int creditLimit)
          Set the credit limit
protected  void setJavaField(Field javaField, Object value)
          Set the value of a Java field.
 void setName(String name)
          Set the name
 void setStartDate(Date startDate)
          Set the starting date
 String toString()
           
 
Methods inherited from class com.ashridgetech.prevdb.client.AbstractPersistentObject
getField, getFields, getManager, getOid, getPersistentField, notifyUpdate, notifyUpdate, notifyUpdate, setField, setFields
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final PersistentField NAME

START_DATE

public static final PersistentField START_DATE

CREDIT_LIMIT

public static final PersistentField CREDIT_LIMIT

BALANCE

public static final PersistentField BALANCE

B

public static final PersistentField B

PERSISTENT_FIELDS

protected static final PersistentField[] PERSISTENT_FIELDS
Constructor Detail

TestClassA

public TestClassA(PrevDb prevDb)

TestClassA

public TestClassA(PrevDb prevDb,
                  String name,
                  Date startDate,
                  int creditLimit,
                  BigDecimal balance)
Method Detail

getPersistentFields

protected PersistentField[] getPersistentFields()
Description copied from class: AbstractPersistentObject
Provide an array of PersistentFields for this object. Must include the persistent fields of the superclass, if any

Overrides:
getPersistentFields in class AbstractPersistentObject
Returns:
the array of PersistentFields

getJavaField

protected Object getJavaField(Field javaField)
                       throws IllegalAccessException
Get the value of a Java field. Must be duplicated in each subclass to avoid access restrictions. The code required is simply return javaField.get( this );

Overrides:
getJavaField in class AbstractPersistentObject
Parameters:
javaField - the Field to get the value of
Returns:
the value
IllegalAccessException

setJavaField

protected void setJavaField(Field javaField,
                            Object value)
                     throws IllegalAccessException
Set the value of a Java field. Must be duplicated in each subclass to avoid access restrictions. The code required is simply javaField.set( this, value );

Overrides:
setJavaField in class AbstractPersistentObject
Parameters:
javaField - the Field to set the value of
value - the value to set
IllegalAccessException

getName

public String getName()
Get the name

Returns:
the name

setName

public void setName(String name)
Set the name

Parameters:
name -

getStartDate

public Date getStartDate()
Get the starting date

Returns:
the starting date

setStartDate

public void setStartDate(Date startDate)
Set the starting date

Parameters:
startDate -

getCreditLimit

public int getCreditLimit()
Get the credit limit

Returns:
the credit limit

setCreditLimit

public void setCreditLimit(int creditLimit)
Set the credit limit

Parameters:
creditLimit -

getBalance

public BigDecimal getBalance()
Get the cash balance

Returns:
the cash balance

getB

public TestClassB getB()
Get the B

Returns:
the B

setB

public void setB(TestClassB b)
Set the B

Parameters:
b -

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003 Ashridge Technologies Ltd. All Rights Reserved.