Example: Container Managed Persistence over anything -- EJB

Usage Scenario

For a CMP bean whose fully-qualified name is com.ibm.test.Account (whose bean implementation class is named AccountBean), the AccountBeanUserDefinedPushDownMethods interface would be in the com.ibm.test.websphere_deploy package, and the AccountBeanUserDefinedPushDownMethodsImpl for a backEndType of EJB would be in the com.ibm.test.websphere_deploy.ejb package.

Example

public float computeAverageDailyBalance(Date arg1, Date arg2, AccountBean bean,
 Object connection) throws AccountAccessException, ResourceException
{
   AccountBackendLocalHome home = helper.getEJBHome("ejb/AccountBackend",
       AccountBackendLocalHome.class);
 //throws ResourceException on error

   AccountBackend bean = null;
   float returnValue = 0.0;
   int id = bean.getId();
   try {
      bean = home.create();
      returnValue = bean.computeAverageDailyBalance(id, arg1, arg2);
   } catch (Exception e) {
      throw helper.createResourceException(e, this.getClass());
   }

   if (returnValue == -1) throw new AccountAccessException();

   return returnValue;
}



Searchable topic ID:   rejb_cmpa2
Last updated: Jun 21, 2007 8:07:48 PM CDT    WebSphere Business Integration Server Foundation, Version 5.0.2
http://publib.boulder.ibm.com/infocenter/wasinfo/index.jsp?topic=/com.ibm.wasee.doc/info/ee/ae/rejb_cmpa2.html

Library | Support | Terms of Use | Feedback