Here is the bean code ...
package com.ltcg.resol.dataaccess.exrule;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import java.rmi.RemoteException;
import javax.ejb.EJBException;
import javax.ejb.CreateException;
import java.sql.SQLException;
import javax.ejb.FinderException;
import java.util.Collection;
/**
* @ejbHome <{com.ltcg.resol.DataAccess.ExRule.resol_pol_ex_rule_typeHome}>
* @ejbRemote <{com.ltcg.resol.DataAccess.ExRule.resol_pol_ex_rule_type}>
* @ejbPrimaryKey <{com.ltcg.resol.DataAccess.ExRule.resol_pol_ex_rule_typePK}>
* @ejbSchemaName dbo*/
public class resol_pol_ex_rule_typeBean implements EntityBean {
private EntityContext ctx;
public int resol_pol_ex_rule_type_id;
public short rpert_logical_operator_cd;
public short rpert_value;
public short resol_pol_ex_type_status_cd;
public short resol_pol_ex_type_cd;
public int resol_pol_ex_type_status_id;
public int resol_pol_ex_rule_id;
private resol_pol_ex_ruleBean FK_relationship2;
public void setEntityContext(EntityContext context) throws RemoteException, EJBException {
ctx = context;
}
public void unsetEntityContext() throws RemoteException, EJBException {
ctx = null;
}
public void ejbActivate() throws RemoteException, EJBException {
}
public void ejbPassivate() throws RemoteException, EJBException {
}
public void ejbRemove() throws RemoteException, EJBException {
}
public void ejbStore() throws RemoteException, EJBException {
}
public void ejbLoad() throws RemoteException, EJBException {
}
/**
* This method initializes the bean and creates a record in the resol_pol_ex_rule_type table
* @param int resol_pol_ex_rule_type_id
* short rpert_logical_operator_cd
*
* @return Object;Object of type resol_pol_ex_rule_typePK
* @exception CreateException, EJBException, RemoteException, SQLException
*/
public resol_pol_ex_rule_typePK ejbCreate(int resol_pol_ex_rule_type_id, short rpert_logical_operator_cd, short rpert_value, short resol_pol_ex_type_status_cd, short resol_pol_ex_type_cd, int resol_pol_ex_type_status_id, int resol_pol_ex_rule_id) throws CreateException, EJBException, RemoteException, SQLException {
this.resol_pol_ex_rule_type_id = resol_pol_ex_rule_type_id;
this.rpert_logical_operator_cd = rpert_logical_operator_cd;
this.rpert_value = rpert_value;
this.resol_pol_ex_type_status_cd = resol_pol_ex_type_status_cd;
this.resol_pol_ex_type_cd = resol_pol_ex_type_cd;
this.resol_pol_ex_type_status_id = resol_pol_ex_type_status_id;
this.resol_pol_ex_rule_id = resol_pol_ex_rule_id;
return null;
}
public void ejbPostCreate(int resol_pol_ex_rule_type_id, short rpert_logical_operator_cd, short rpert_value, short resol_pol_ex_type_status_cd, short resol_pol_ex_type_cd, int resol_pol_ex_type_status_id, int resol_pol_ex_rule_id) throws CreateException, EJBException, RemoteException, SQLException {
// Write your code here
}
/**
* This method finds the unique exclusion rule type indexed by primary key
*
* @param Object;Object of type resol_pol_ex_rule_typePK
* @return Object;Object of type resol_pol_ex_rule_type
* @exception FinderException,EJBException, RemoteException, SQLException
*/
public resol_pol_ex_rule_type ejbFindByPrimaryKey( resol_pol_ex_rule_typePK pk) throws FinderException, RemoteException, EJBException {
this.resol_pol_ex_rule_type_id = pk.resol_pol_ex_rule_type_id;
return null;
}
/**
* This method finds all rule types for a rule
*
* @param int resol_pol_ex_rule_id
* @return Collection;collection of primary keys
* @exception FinderException,EJBException, RemoteException, SQLException
*/
public Collection ejbFindAllRuleTypeForRule(int param) throws FinderException, RemoteException, EJBException {
this.resol_pol_ex_rule_id = param;
return null;
}
public int getResol_pol_ex_rule_type_id(){ return resol_pol_ex_rule_type_id; }
public void setResol_pol_ex_rule_type_id(int param){ this.resol_pol_ex_rule_type_id = param; }
public short getRpert_logical_operator_cd(){ return rpert_logical_operator_cd; }
public void setRpert_logical_operator_cd(short param){ this.rpert_logical_operator_cd = param; }
public short getRpert_value(){ return rpert_value; }
public void setRpert_value(short param){ this.rpert_value = param; }
public short getResol_pol_ex_type_status_cd(){ return resol_pol_ex_type_status_cd; }
public void setResol_pol_ex_type_status_cd(short param){ this.resol_pol_ex_type_status_cd = param; }
public short getResol_pol_ex_type_cd(){ return resol_pol_ex_type_cd; }
public void setResol_pol_ex_type_cd(short param){ this.resol_pol_ex_type_cd = param; }
public int getResol_pol_ex_type_status_id(){ return resol_pol_ex_type_status_id; }
public void setResol_pol_ex_type_status_id(int param){ this.resol_pol_ex_type_status_id = param; }
public int getResol_pol_ex_rule_id() {return resol_pol_ex_rule_id ;}
public void setResol_pol_ex_rule_id(int param) { this.resol_pol_ex_rule_id = param ;}
}
*************************************************\
The method from which I am calling the create method is ....
public void createExRuleTypes(EJBFactoryWrapper ejbFact, ExRuleTypeVO param) throws RemoteException, ExRuleException {
jndiName = "java:resol_pol_ex_rule_typeBean";
try
{
System.out.println("In createExRuleType - ");
System.out.println("In createExRuleType - " + "ruleTypeId=" + param.ruleTypeId + " logicalOpCd= " +
param.logicalOpCd + " ruleTypeValue=" + param.ruleTypeValue +
" ruleTypeStatusCd=" + param.ruleTypeStatusCd + " typeCd=" + param.typeCd
+ " typeStatusId=" + param.typeStatusId + " ruleId=" + param.ruleId);
resolPolExRuleTypeHome = (resol_pol_ex_rule_typeHome) ejbFact.getHomeInterface(jndiName);
System.out.println("In createExRuleType - Got the home interface " + resolPolExRuleTypeHome);
resolPolExRuleType = resolPolExRuleTypeHome.create(param.ruleTypeId, param.logicalOpCd, param.ruleTypeValue, param.ruleTypeStatusCd, param.typeCd, param.typeStatusId, param.ruleId);
System.out.println("In createExRuleType - Created the data " );
}
catch (Exception exception)
{
throw new ExRuleException("Error creating rule type in ExRuleBean" + exception.getMessage(), exception);
}
}
Hope this info will do.
Thanks ,
Prashanth