Extended Deployment, Version 6.0.x
Operating Systems: AIX, HP-UX, Linux, Solaris, Windows
Create entity EJBs Account and AccountOwner
About this task
To simplify the sample, you use two entity beans: Account
and AccountOwner. There is a one to many relationship between Account
and AccountOwner.
Procedure
Using WebSphere Studio
Application Developer (WSAD) V5.1, select File > New > Enterprise
Bean to create a Container-managed persistence (CMP) enterprise
bean. Although the steps are described using WebSphere Studio Application Developer,
most steps should work using Rational Application
Developer.
Type ProxyDSAccountSampleEJB for the project name,
then click Next.
Configure the bean.
Select the field Entity bean with container-managed
persistence (CMP).
Select CMP 2.0 Bean.
Enter Account as the Bean name, and com.ibm.websphere.proxyds as
the Default package.
Click Next.
Provide further configuration for the bean.
Select local client view.
Deselect remote client view.
Create four CMP attribute fields.
Create accountId. accountID is
a String the key field.
Create balance. balance is
type Double.
Create creationData.creationData is
type java.sql.Timestamp.
Create openBalance. openBalance is
type Double.
Click Finish.
Repeat step six to create CMP EJB AccountOwner.
Create ssn. ssn is type String and
the key field.
Create name. name is type String.
Create address.address is
type String.
Create phone. phone is type String.
You can create a one-to-many relationship between Account
and AccountOwner.
Click the Beans tab on the right panel.
Select Account from the Beans list.
Scroll down to the Relationships list, then click Add.
Select Account and AccountOwner as the source
EJB.
Click Next.
Select Many for the Multiplicity for role
account, then check cascade delete for role account. Leave
others as default.
Last updated: Oct 16, 2009 11:11:31 AM EDT http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=/com.ibm.websphere.xd.doc/info/WPF51/twpentityejb.html