EJB中的会话bean能否调用另一个已打成jar包的EJB中的实体bean????? 不通过会话bean,直接调实体bean的方法也行???就好像在一个EJB中调的一样?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考http://home.itdrp.com/ansonsoft/shoppingdoc/我 写的 文档 通过JNDI应该可以实现~ 不过我没有试过:) 但是调用同一个包的实体bean时,需要引用这个bean,那我调另一个包的bean时,如何引用呢??? 请看这段代码EJB 会话 bean 包装 EJB 实体 bean import java.rmi.RemoteException; import java.security.Identity; import java.util.Properties; import javax.ejb.*; import com.ibm.uxo.bestpractices.datamodels.*; public class EmployeeRosterBean implements SessionBean { private EmployeeHome employeeHome; private javax.ejb.SessionContext mySessionCtx = null; final static long serialVersionUID = 3206093459760846163L; public void ejbCreate() throws javax.ejb.CreateException, java.rmi.RemoteException { employeeHome = EmployeeEjbHomeCacheHelper.getEmployeeHome()} public EmployeeStruct getEmployeeInfoFor(String empno) { Employee theEmployee = null; EmployeeStructure returnValue = new EmployeeStructure(); try { theEmployee = employeeFindByPrimaryKey(new EmployeeKey(empno)); returnValue.setSex(theEmployee.getSex()); returnValue.setSalary(theEmployee.getSalary()); returnValue.setPhoneno(theEmployee.getPhoneno()); returnValue.setMidinit(theEmployee.getMidinit()); returnValue.setLastname(theEmployee.getLastname()); returnValue.setJob(theEmployee.getJob()); returnValue.setHiredate(theEmployee.getHiredate()); returnValue.setFirstnme(theEmployee.getFirstnme()); returnValue.setEmpno(empno); returnValue.setEdlevel(theEmployee.getEdlevel()); returnValue.setComm(theEmployee.getComm()); returnValue.setBonus(theEmployee.getBonus()); returnValue.setBirthdate(theEmployee.getBirthdate()); returnValue.setWorkDept(theEmployee.getWorkdept()); } catch (Exception e) { e.printStackTrace(); } return returnValue; } public void ejbActivate() throws java.rmi.RemoteException {} public void ejbPassivate() throws java.rmi.RemoteException {} public voide ejbRemove() throws java.rmi.RemoteException {} } java线程睡眠问题 如何在js中获取迭代器迭代出来的值? 面试题目,技术和非技术的 关于hibernate表的映射问题? 抢分问题!!高手的进来! 咨询个关于hibernate查询语句中两个select子句合并成一个问题。懂的高手来。 struts中objectFactory的问题 求救 oralce的portal支持框架吗? 关于struts中自带的标签的问题 请教 EJB 集群怎么弄 JCE(Java 密码术扩展) JSSE(Java 安全套接字扩展) JAAS(Java 认证和授权服务)
我 写的 文档
EJB 会话 bean 包装 EJB 实体 bean import java.rmi.RemoteException;
import java.security.Identity;
import java.util.Properties;
import javax.ejb.*;
import com.ibm.uxo.bestpractices.datamodels.*; public class EmployeeRosterBean implements SessionBean {
private EmployeeHome employeeHome;
private javax.ejb.SessionContext mySessionCtx = null;
final static long serialVersionUID = 3206093459760846163L; public void ejbCreate() throws javax.ejb.CreateException,
java.rmi.RemoteException {
employeeHome = EmployeeEjbHomeCacheHelper.getEmployeeHome()} public EmployeeStruct getEmployeeInfoFor(String empno) {
Employee theEmployee = null;
EmployeeStructure returnValue = new EmployeeStructure(); try {
theEmployee = employeeFindByPrimaryKey(new EmployeeKey(empno)); returnValue.setSex(theEmployee.getSex());
returnValue.setSalary(theEmployee.getSalary());
returnValue.setPhoneno(theEmployee.getPhoneno());
returnValue.setMidinit(theEmployee.getMidinit());
returnValue.setLastname(theEmployee.getLastname());
returnValue.setJob(theEmployee.getJob());
returnValue.setHiredate(theEmployee.getHiredate());
returnValue.setFirstnme(theEmployee.getFirstnme());
returnValue.setEmpno(empno);
returnValue.setEdlevel(theEmployee.getEdlevel());
returnValue.setComm(theEmployee.getComm());
returnValue.setBonus(theEmployee.getBonus());
returnValue.setBirthdate(theEmployee.getBirthdate());
returnValue.setWorkDept(theEmployee.getWorkdept());
} catch (Exception e) {
e.printStackTrace();
}
return returnValue;
} public void ejbActivate() throws java.rmi.RemoteException {}
public void ejbPassivate() throws java.rmi.RemoteException {}
public voide ejbRemove() throws java.rmi.RemoteException {}
}