org.jwaf.bo
Class BusinessLogic

java.lang.Object
  |
  +--org.jwaf.bo.BusinessLogic

public class BusinessLogic
extends java.lang.Object

BusinessLogic.java This is a business logic class that brings Apache Struts and Exolab Castor frameworks together. It serves as: (1) Struts action (2) Persistent object domain (3) Business object logic


Constructor Summary
  BusinessLogic()
          Default constructor
protected BusinessLogic(java.lang.Class classType)
          This is a protected constructor that is intended to be called by inhereting classes by passing the class type of the business object.
 
Method Summary
 void addBusinessObject(BusinessObject businessObject)
          Create a new business object in persistence and set encapsulated business object to it.
 void deleteBusinessObject()
          Delete the encapsulated business object
 void deleteBusinessObject(BusinessObject businessObject)
          Delete the business object from persistent that matches the passed transient business object.
 org.exolab.castor.jdo.Persistent find(java.lang.Object id)
          Given the primary key, this method finds the object, sets the encapsulated business object to it and returns a persistent object.
 BusinessObjectCollection findAllBusinessObjects()
          Get all business objects of the type
 BusinessObject findBusinessObject(java.lang.Object id)
          Given the primary key, this method finds the object, sets the encapsulated business object to it and returns a business object.
 BusinessObject getBusinessObject()
          Gets the encapsulated business object
 void setBusinessObject(BusinessObject businessObject)
          Sets the encapsulated business object to passed business object.
 void updateBusinessObject()
          Update a business object in persistence
 void updateBusinessObject(BusinessObject businessObject)
          Update a business object in persistence, also sets encapsulated business object to the parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BusinessLogic

public BusinessLogic()
Default constructor

BusinessLogic

protected BusinessLogic(java.lang.Class classType)
This is a protected constructor that is intended to be called by inhereting classes by passing the class type of the business object.
Parameters:
classType - Should be the BusinessObject.class
Method Detail

find

public org.exolab.castor.jdo.Persistent find(java.lang.Object id)
Given the primary key, this method finds the object, sets the encapsulated business object to it and returns a persistent object.
Parameters:
id - Primary key object
Returns:
Found persistent object or null (not found)

setBusinessObject

public void setBusinessObject(BusinessObject businessObject)
Sets the encapsulated business object to passed business object.
Parameters:
businessObject - Business object to encapsulate.

findBusinessObject

public BusinessObject findBusinessObject(java.lang.Object id)
Given the primary key, this method finds the object, sets the encapsulated business object to it and returns a business object.
Parameters:
id - Primary key object
Returns:
The business object if found, else null

findAllBusinessObjects

public BusinessObjectCollection findAllBusinessObjects()
Get all business objects of the type
Returns:
A business object collection

updateBusinessObject

public void updateBusinessObject(BusinessObject businessObject)
Update a business object in persistence, also sets encapsulated business object to the parameter
Parameters:
businessObject - Transient instance of the business object

updateBusinessObject

public void updateBusinessObject()
Update a business object in persistence

deleteBusinessObject

public void deleteBusinessObject(BusinessObject businessObject)
Delete the business object from persistent that matches the passed transient business object.
Parameters:
businessObject - A transient business object to be deleted from persistence

deleteBusinessObject

public void deleteBusinessObject()
Delete the encapsulated business object

addBusinessObject

public void addBusinessObject(BusinessObject businessObject)
Create a new business object in persistence and set encapsulated business object to it. In case of generated key, primary key of transient object will be ignored.
Parameters:
businessObject - Transient instance of business object.

getBusinessObject

public BusinessObject getBusinessObject()
Gets the encapsulated business object
Returns:
Encapsulated business object