第一个设计模式非常简单。一个公司和雇员的entity bean和
下面给出的entity bean的代码片断是类似的。它们是由jbuilder4的
entitybean模版生成的。所有的字段都声明为public的cmp字段。
code snippet for company entity bean
public class companybean implements entitybean {
entitycontext entitycontext;
public integer comid; //the primary key
public string comname; //the company name
public string comdescription //basic description
public timestamp mutationdate //explained later
public integer ejbcreate(<params>) throws
createexception {
return null;
}
//various get() and set() for every column/field
// which are exposed in the remote interface as well
code snippet for employee entity bean
public class employeebean implements entitybean {
entitycontext entitycontext;
public integer empid; //the primary key
public integer comid; //the company foreign key
public string empfirstname; //the employee firstname
public string emplastname // the employee lastname
public timestamp mutationdate //explained later
public integer ejbcreate(<params>) throws
createexception {
return null;
}
Java Asp PHP .Net XML C/C++ CGI VB Jsp J2ee J2se J2me EJB Servlet Tomcat Resin Struts Weblogic Eclipse ANT GUI JMS Web servise IDEA Webphere Hibernate Spring Jboss Applet Swing Socket Javamail Perl Ajax P2P 安全 模式 框架 测试 开源 游戏
Windows XP Windows 2000 Windows 2003 Windows Me Windows 9.x Linux UNIX 注册表 操作系统 服务器 应用服务器