org.gjt.tw.dbobjects.test.mysql
Class Customer

java.lang.Object
  |
  +--org.gjt.tw.dbobjects.StorableObject
        |
        +--org.gjt.tw.dbobjects.test.mysql.Customer

public class Customer
extends StorableObject

Test class containing data about a customer. ID is the primary key of this object. The id is created by MySQL's auto_increment feature.


Fields inherited from class org.gjt.tw.dbobjects.StorableObject
isStoredInDatabase
 
Constructor Summary
Customer()
          TestObject constructor comment.
 
Method Summary
 Address[] getAddressList()
          This method was created in VisualAge.
static Customer getByName(java.lang.String name)
          Searches for a customer in the database given the name of a customer.
 java.sql.Date getCreated()
          This method was created in VisualAge.
 Address getCurrentAddress()
          This method was created in VisualAge.
 long getCurrentAddressId()
          This method was created in VisualAge.
 long getId()
          This method was created in VisualAge.
protected  ObjectMapping getMapping()
          Returns object mapping.
 java.lang.String getName()
          Returns name of customer.
 java.lang.String getPassword()
          Returns password of customer.
static void init()
          Initialization of object mapping.
 void setCreated(java.sql.Date newValue)
          This method was created in VisualAge.
 void setCurrentAddress(Address address)
          This method was created in VisualAge.
 void setCurrentAddressId(long newValue)
          This method was created in VisualAge.
 void setId(long newValue)
          This method was created in VisualAge.
 void setName(java.lang.String newValue)
          Sets name of customer.
 void setPassword(java.lang.String newValue)
          Sets password of customer.
 
Methods inherited from class org.gjt.tw.dbobjects.StorableObject
delete, getDomTree, print, store, toXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Customer

public Customer()
TestObject constructor comment.
Method Detail

setCreated

public void setCreated(java.sql.Date newValue)
This method was created in VisualAge.
Parameters:
newValue - java.sql.Date

setCurrentAddress

public void setCurrentAddress(Address address)
This method was created in VisualAge.
Parameters:
address - databasemanagement.test.Address

setCurrentAddressId

public void setCurrentAddressId(long newValue)
This method was created in VisualAge.
Parameters:
newValue - long

setId

public void setId(long newValue)
This method was created in VisualAge.
Parameters:
newValue - long

setName

public void setName(java.lang.String newValue)
Sets name of customer.
Parameters:
newValue - java.lang.String

setPassword

public void setPassword(java.lang.String newValue)
Sets password of customer.
Parameters:
newValue - java.lang.String

getAddressList

public Address[] getAddressList()
                         throws DatabaseException,
                                ObjectException
This method was created in VisualAge.
Returns:
dbobjects.test.Address[]
Throws:
DatabaseException - Description of Exception
ObjectException - Description of Exception

getCreated

public java.sql.Date getCreated()
This method was created in VisualAge.
Returns:
java.sql.Date

getCurrentAddress

public Address getCurrentAddress()
                          throws DatabaseException,
                                 ObjectException
This method was created in VisualAge.
Returns:
databasemanagement.test.Address
Throws:
DatabaseException - Description of Exception
ObjectException - Description of Exception

getCurrentAddressId

public long getCurrentAddressId()
This method was created in VisualAge.
Returns:
long

getId

public long getId()
This method was created in VisualAge.
Returns:
long

getName

public java.lang.String getName()
Returns name of customer.
Returns:
java.lang.String

getPassword

public java.lang.String getPassword()
Returns password of customer.
Returns:
java.lang.String

getMapping

protected ObjectMapping getMapping()
Returns object mapping.
Overrides:
getMapping in class StorableObject
Returns:
databasemanagement2.ObjectMapping

getByName

public static Customer getByName(java.lang.String name)
                          throws DatabaseException,
                                 ObjectException
Searches for a customer in the database given the name of a customer. Upon success a Customer object is returned.
Parameters:
name - name of a customer
Returns:
Customer object if it exists - null otherwise.
Throws:
DatabaseException - Description of Exception
ObjectException - Description of Exception

init

public static void init()
                 throws ObjectException,
                        IncompleteDefinitionException
Initialization of object mapping. Has to be called once before first use.
Throws:
ObjectException - Description of Exception
IncompleteDefinitionException - Description of Exception