PSE 2000 Group 4

jobmatch.data
Class PersonBDO

java.lang.Object
  |
  +--jobmatch.data.PersonBDO

public class PersonBDO
extends Object
implements Serializable

PersonBDO contains the same set and get methods as the PersonDO class. Business Object (BO) classes typically need these set and get methods. So by deriving a BO from a BDO, or by implementing a BO that contains a BDO, the developer of the BO is spared some work.

Version:
$Revision: 1.4 $
See Also:
Serialized Form

Field Summary
protected  PersonDO DO
          The PersonDO object upon which the set and get methods operate.
 
Constructor Summary
PersonBDO()
          Constructor required by PersonBDO.create methods.
PersonBDO(PersonDO DO)
          Constructor for use by classes derived from PersonBDO.
 
Method Summary
protected  void afterAnySet()
           
protected  void beforeAnyGet()
          The developer of a Business Object that derives from this class can override the methods: beforeAnyGet beforeAnySet afterAnySet to handle any general assertions or cleanup needed for get and set methods.
protected  void beforeAnySet()
           
 void commit()
          Inserts/Updates the DO into its table.
 void commit(jobmatch.data.DBTransaction dbt)
          Inserts/Updates the DO into its table.
static PersonBDO createExisting(PersonDO DO)
          The createExisting method is used to create a PersonBDO from a PersonDO that was returned by the PersonQuery class.
static PersonBDO createVirgin()
          Like the class PersonDO, this class acts as a factory.
 void delete()
          Deletes the DO from its table.
 void delete(jobmatch.data.DBTransaction dbt)
          Deletes the DO from its table.
 AdressDO getAdress()
          Get Adress of the PersonDO
 AdressBDO getAdressBDO()
          Get BDO-wrapped Adress of the PersonDO
static PersonBDO[] getBDOarray()
          The getBDOarray method performs a database query to return an array of PersonBDO objects representing all the rows in the Person table.
 Date getBirthdate()
          Get Birthdate of the PersonDO
 PersonDO getDO()
          Note: This method is intended for use only by other BDO classes.
 String getEmail()
          Get Email of the PersonDO
 String getFax()
          Get Fax of the PersonDO
 String getFname()
          Get Fname of the PersonDO
 String getHandle()
          The methods getHandle hasMatchingHandle are used by Presentation Objects that need to populate HTML select lists with PersonBDO objects as options.
 String getLname()
          Get Lname of the PersonDO
 String getNatel()
          Get Natel of the PersonDO
 CountryDO getNationality()
          Get Nationality of the PersonDO
 CountryBDO getNationalityBDO()
          Get BDO-wrapped Nationality of the PersonDO
 String getPhone()
          Get Phone of the PersonDO
 PictureDO getPicture()
          Get Picture of the PersonDO
 PictureBDO getPictureBDO()
          Get BDO-wrapped Picture of the PersonDO
 String getResidence()
          Get Residence of the PersonDO
 String getSex()
          Get Sex of the PersonDO
 String getURL()
          Get URL of the PersonDO
 boolean hasMatchingHandle(String handle)
           
protected  void modifyDO(jobmatch.data.DBTransaction dbt, boolean delete)
          Modifies the DO within its table.
protected  void okToCommitAdress(AdressDO member)
          A stub method for implementing pre-commit assertions for the Adress data member.
protected  void okToCommitNationality(CountryDO member)
          A stub method for implementing pre-commit assertions for the Nationality data member.
protected  void okToCommitPicture(PictureDO member)
          A stub method for implementing pre-commit assertions for the Picture data member.
protected  void okToDeleteAdress(AdressDO member)
          A stub method for implementing pre-delete assertions for the Adress data member.
protected  void okToDeleteNationality(CountryDO member)
          A stub method for implementing pre-delete assertions for the Nationality data member.
protected  void okToDeletePicture(PictureDO member)
          A stub method for implementing pre-delete assertions for the Picture data member.
 void setAdress(AdressBDO Adress)
          Set Adress of the PersonDO
 void setAdress(AdressDO Adress)
          Set Adress of the PersonDO
 void setBirthdate(Date Birthdate)
          Set Birthdate of the PersonDO
 void setEmail(String Email)
          Set Email of the PersonDO
 void setFax(String Fax)
          Set Fax of the PersonDO
 void setFname(String Fname)
          Set Fname of the PersonDO
 void setLname(String Lname)
          Set Lname of the PersonDO
 void setNatel(String Natel)
          Set Natel of the PersonDO
 void setNationality(CountryBDO Nationality)
          Set Nationality of the PersonDO
 void setNationality(CountryDO Nationality)
          Set Nationality of the PersonDO
 void setPhone(String Phone)
          Set Phone of the PersonDO
 void setPicture(PictureBDO Picture)
          Set Picture of the PersonDO
 void setPicture(PictureDO Picture)
          Set Picture of the PersonDO
 void setResidence(String Residence)
          Set Residence of the PersonDO
 void setSex(String Sex)
          Set Sex of the PersonDO
 void setURL(String URL)
          Set URL of the PersonDO
 String toString()
          for debugging
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DO

protected PersonDO DO
The PersonDO object upon which the set and get methods operate. This member is protected so that classes derived from PersonBDO can access the underlying Data Object.
Constructor Detail

PersonBDO

public PersonBDO(PersonDO DO)
Constructor for use by classes derived from PersonBDO. Example usage: class CustomerBO extends CustomerBDO { // a BDO class is commonly extended in order to implement: public void beforeAnySet() throws Exception { if ( CustomerDO should not be altered ) throw new ApplicationException( "ERROR" ); } public CustomerBO( CustomerDO DO ) { super( DO ); } } class SomePresentationLayerClass { public CustomerBO findCustomer( String name ) { CustomerQuery q = new CustomerQuery(); q.setQueryName( name ); CustomerDO DO = q.getNextDO(); // Here the CustomerBO ctor fires the CustomerBDO ctor. return new CustomerBO( DO ); } }

PersonBDO

public PersonBDO()
          throws Exception
Constructor required by PersonBDO.create methods.
Method Detail

getDO

public PersonDO getDO()
Note: This method is intended for use only by other BDO classes. Presentation Layer classes should (theoretically) always use the Business Layer (BDO) to create/access Data Layer (DO) objects. The overhead for using BDO objects is small (the BDO classes are fairly lightweight.)
Returns:
The DO object held by this BDO object.

createVirgin

public static PersonBDO createVirgin()
                              throws Exception
Like the class PersonDO, this class acts as a factory. Business Object (BO) classes typically need these set and get methods. So by deriving a BO from a BDO, or by implementing a BO that contains one or more BDOs, the developer of the BO is spared some work.
Throws:
Exception - If an error occurs.

createExisting

public static PersonBDO createExisting(PersonDO DO)
The createExisting method is used to create a PersonBDO from a PersonDO that was returned by the PersonQuery class.

getBDOarray

public static PersonBDO[] getBDOarray()
                               throws jobmatch.data.DataObjectException
The getBDOarray method performs a database query to return an array of PersonBDO objects representing all the rows in the Person table. This method is a minimal example of using a Query class. To restrict the set of objects returned, you could invoke query.setXxx(), where Xxx is an Attribute of PersonDO which was marked as "Can be queried" in the DODS Attribute Editor.
Throws:
jobmatch.data.DataObjectException - If an object is not found in the database.

beforeAnyGet

protected void beforeAnyGet()
The developer of a Business Object that derives from this class can override the methods: beforeAnyGet beforeAnySet afterAnySet to handle any general assertions or cleanup needed for get and set methods.

beforeAnySet

protected void beforeAnySet()
                     throws Exception

afterAnySet

protected void afterAnySet()

getHandle

public String getHandle()
                 throws jobmatch.data.DatabaseManagerException
The methods getHandle hasMatchingHandle are used by Presentation Objects that need to populate HTML select lists with PersonBDO objects as options. The getHandle() method is used to set the value for each option, and the hasMatchingHandle() methods are used to lookup the Data Object when the selection has been made. This PersonBDO object holds a reference to a PersonDO object. The id of this PersonBDO is the id of its PersonDO.
Returns:
id of this BDO as a string If an object id can't be allocated for this object.
Throws:
jobmatch.data.DatabaseManagerException - If a connection to the database cannot be established, etc.

hasMatchingHandle

public boolean hasMatchingHandle(String handle)
Parameters:
handle - String representation of the id for this BDO
Returns:
boolean True if the string version of the id of this DO matches passed handle
See Also:
getHandle

toString

public String toString()
for debugging
Overrides:
toString in class Object

getPicture

public PictureDO getPicture()
                     throws jobmatch.data.DataObjectException
Get Picture of the PersonDO
Returns:
Picture of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setPicture

public void setPicture(PictureDO Picture)
                throws jobmatch.data.DataObjectException
Set Picture of the PersonDO
Parameters:
Picture - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getPictureBDO

public PictureBDO getPictureBDO()
                         throws jobmatch.data.DataObjectException
Get BDO-wrapped Picture of the PersonDO
Returns:
BDO-wrapped Picture of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setPicture

public void setPicture(PictureBDO Picture)
                throws jobmatch.data.DataObjectException
Set Picture of the PersonDO
Parameters:
BDO-wrapped - Picture of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getEmail

public String getEmail()
                throws jobmatch.data.DataObjectException
Get Email of the PersonDO
Returns:
Email of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setEmail

public void setEmail(String Email)
              throws jobmatch.data.DataObjectException
Set Email of the PersonDO
Parameters:
Email - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getFax

public String getFax()
              throws jobmatch.data.DataObjectException
Get Fax of the PersonDO
Returns:
Fax of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setFax

public void setFax(String Fax)
            throws jobmatch.data.DataObjectException
Set Fax of the PersonDO
Parameters:
Fax - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getAdress

public AdressDO getAdress()
                   throws jobmatch.data.DataObjectException
Get Adress of the PersonDO
Returns:
Adress of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setAdress

public void setAdress(AdressDO Adress)
               throws jobmatch.data.DataObjectException
Set Adress of the PersonDO
Parameters:
Adress - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getAdressBDO

public AdressBDO getAdressBDO()
                       throws jobmatch.data.DataObjectException
Get BDO-wrapped Adress of the PersonDO
Returns:
BDO-wrapped Adress of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setAdress

public void setAdress(AdressBDO Adress)
               throws jobmatch.data.DataObjectException
Set Adress of the PersonDO
Parameters:
BDO-wrapped - Adress of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getFname

public String getFname()
                throws jobmatch.data.DataObjectException
Get Fname of the PersonDO
Returns:
Fname of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setFname

public void setFname(String Fname)
              throws jobmatch.data.DataObjectException
Set Fname of the PersonDO
Parameters:
Fname - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getLname

public String getLname()
                throws jobmatch.data.DataObjectException
Get Lname of the PersonDO
Returns:
Lname of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setLname

public void setLname(String Lname)
              throws jobmatch.data.DataObjectException
Set Lname of the PersonDO
Parameters:
Lname - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getNatel

public String getNatel()
                throws jobmatch.data.DataObjectException
Get Natel of the PersonDO
Returns:
Natel of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setNatel

public void setNatel(String Natel)
              throws jobmatch.data.DataObjectException
Set Natel of the PersonDO
Parameters:
Natel - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getPhone

public String getPhone()
                throws jobmatch.data.DataObjectException
Get Phone of the PersonDO
Returns:
Phone of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setPhone

public void setPhone(String Phone)
              throws jobmatch.data.DataObjectException
Set Phone of the PersonDO
Parameters:
Phone - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getResidence

public String getResidence()
                    throws jobmatch.data.DataObjectException
Get Residence of the PersonDO
Returns:
Residence of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setResidence

public void setResidence(String Residence)
                  throws jobmatch.data.DataObjectException
Set Residence of the PersonDO
Parameters:
Residence - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getSex

public String getSex()
              throws jobmatch.data.DataObjectException
Get Sex of the PersonDO
Returns:
Sex of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setSex

public void setSex(String Sex)
            throws jobmatch.data.DataObjectException
Set Sex of the PersonDO
Parameters:
Sex - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getBirthdate

public Date getBirthdate()
                  throws jobmatch.data.DataObjectException
Get Birthdate of the PersonDO
Returns:
Birthdate of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setBirthdate

public void setBirthdate(Date Birthdate)
                  throws jobmatch.data.DataObjectException
Set Birthdate of the PersonDO
Parameters:
Birthdate - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getNationality

public CountryDO getNationality()
                         throws jobmatch.data.DataObjectException
Get Nationality of the PersonDO
Returns:
Nationality of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setNationality

public void setNationality(CountryDO Nationality)
                    throws jobmatch.data.DataObjectException
Set Nationality of the PersonDO
Parameters:
Nationality - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getNationalityBDO

public CountryBDO getNationalityBDO()
                             throws jobmatch.data.DataObjectException
Get BDO-wrapped Nationality of the PersonDO
Returns:
BDO-wrapped Nationality of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setNationality

public void setNationality(CountryBDO Nationality)
                    throws jobmatch.data.DataObjectException
Set Nationality of the PersonDO
Parameters:
BDO-wrapped - Nationality of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

getURL

public String getURL()
              throws jobmatch.data.DataObjectException
Get URL of the PersonDO
Returns:
URL of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

setURL

public void setURL(String URL)
            throws jobmatch.data.DataObjectException
Set URL of the PersonDO
Parameters:
URL - of the PersonDO
Throws:
jobmatch.data.DataObjectException - If the object is not found in the database.

commit

public void commit()
            throws SQLException,
                   jobmatch.data.DatabaseManagerException,
                   jobmatch.data.DataObjectException,
                   jobmatch.data.RefAssertionException,
                   jobmatch.data.DBRowUpdateException,
                   jobmatch.data.QueryException
Inserts/Updates the DO into its table.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException - if a Transaction can not be created.
jobmatch.data.RefAssertionException - thrown by okTo method.
SQLException - if any SQL errors occur.

commit

public void commit(jobmatch.data.DBTransaction dbt)
            throws SQLException,
                   jobmatch.data.DatabaseManagerException,
                   jobmatch.data.DataObjectException,
                   jobmatch.data.RefAssertionException,
                   jobmatch.data.DBRowUpdateException,
                   jobmatch.data.QueryException
Inserts/Updates the DO into its table. The transaction is likely provided by the commit() method of another BDO whose DO references this DO.
Parameters:
dbt - The transaction object to use for this operation.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException - if a Transaction can not be created.
jobmatch.data.RefAssertionException - thrown by okTo method.
SQLException - if any SQL errors occur.

delete

public void delete()
            throws SQLException,
                   jobmatch.data.DatabaseManagerException,
                   jobmatch.data.DataObjectException,
                   jobmatch.data.RefAssertionException,
                   jobmatch.data.DBRowUpdateException,
                   jobmatch.data.QueryException
Deletes the DO from its table.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException - if a Transaction can not be created.
jobmatch.data.RefAssertionException - thrown by okTo method.
SQLException - if any SQL errors occur.

delete

public void delete(jobmatch.data.DBTransaction dbt)
            throws SQLException,
                   jobmatch.data.DatabaseManagerException,
                   jobmatch.data.DataObjectException,
                   jobmatch.data.RefAssertionException,
                   jobmatch.data.DBRowUpdateException,
                   jobmatch.data.QueryException
Deletes the DO from its table. The transaction is likely provided by the delete() method of another BDO whose DO references this DO.
Parameters:
dbt - The transaction object to use for this operation.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException - if a Transaction can not be created.
jobmatch.data.RefAssertionException - thrown by okTo method.
SQLException - if any SQL errors occur.

okToCommitPicture

protected void okToCommitPicture(PictureDO member)
                          throws jobmatch.data.RefAssertionException
A stub method for implementing pre-commit assertions for the Picture data member. Implement this stub to throw an RefAssertionException for cases where Picture is not valid for writing to the database.

okToDeletePicture

protected void okToDeletePicture(PictureDO member)
                          throws jobmatch.data.RefAssertionException
A stub method for implementing pre-delete assertions for the Picture data member. Implement this stub to throw an RefAssertionException for cases where Picture is not valid for deletion from the database.

okToCommitAdress

protected void okToCommitAdress(AdressDO member)
                         throws jobmatch.data.RefAssertionException
A stub method for implementing pre-commit assertions for the Adress data member. Implement this stub to throw an RefAssertionException for cases where Adress is not valid for writing to the database.

okToDeleteAdress

protected void okToDeleteAdress(AdressDO member)
                         throws jobmatch.data.RefAssertionException
A stub method for implementing pre-delete assertions for the Adress data member. Implement this stub to throw an RefAssertionException for cases where Adress is not valid for deletion from the database.

okToCommitNationality

protected void okToCommitNationality(CountryDO member)
                              throws jobmatch.data.RefAssertionException
A stub method for implementing pre-commit assertions for the Nationality data member. Implement this stub to throw an RefAssertionException for cases where Nationality is not valid for writing to the database.

okToDeleteNationality

protected void okToDeleteNationality(CountryDO member)
                              throws jobmatch.data.RefAssertionException
A stub method for implementing pre-delete assertions for the Nationality data member. Implement this stub to throw an RefAssertionException for cases where Nationality is not valid for deletion from the database.

modifyDO

protected void modifyDO(jobmatch.data.DBTransaction dbt,
                        boolean delete)
                 throws SQLException,
                        jobmatch.data.DatabaseManagerException,
                        jobmatch.data.DataObjectException,
                        jobmatch.data.RefAssertionException,
                        jobmatch.data.DBRowUpdateException,
                        jobmatch.data.QueryException
Modifies the DO within its table. Performs recursive commit/delete on referenced DOs; all operations occur within a single transaction to allow rollback in the event of error. Only the creator of the transaction releases it.
Parameters:
dbt - The transaction object to use for this operation.
delete - True if doing a delete, otherwise doing insert/update.
Throws:
com.lutris.appserver.server.sql.DatabaseManagerException - if a Transaction can not be created.
jobmatch.data.RefAssertionException - thrown by okTo method.
SQLException - if any SQL errors occur.

PSE 2000 Group 4