WebSphere Extended Deployment, Version 6.0.x     Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

エンティティー EJB Account および AccountOwner の作成

Why and when to perform this task

例を簡単にするために、Account および AccountOwner の 2 つのエンティティー Bean のみを使用します。Account と AccountOwner の間に 1 対多の関係が存在します。

  1. WebSphere Studio Application Developer (WSAD) V5.1 を使用して、「ファイル」>「新規」>「エンタープライズ Bean」を選択し、CMP Enterprise JavaBean (EJB) を作成します。 ステップは、WSAD を使用して説明されていますが、ほとんどのステップは、Rational Application Developer (RAD) を使用して作業します。
  2. プロジェクト名として ProxyDSAccountSampleEJB を入力し、 「次へ」をクリックします。
  3. Bean を構成します。
    1. Entity bean with container-managed persistence (CMP)」フィールドを選択します。
    2. CMP 2.0 Bean」を選択します。
    3. Bean name」として Account を入力し、「Default package」として com.ibm.websphere.proxyds を入力します。
  4. 次へ」をクリックします。
  5. さらに Bean を構成します。
    1. local client view」を選択します。
    2. remote client view」を選択解除します。
  6. 4 つの CMP 属性フィールドを作成します。
    1. accountId を作成します。 accountID は、String 型で、キー・フィールドです。
    2. balance を作成します。 balanceDouble 型です。
    3. creationData を作成します。 creationDatajava.sql.Timestamp 型です。
    4. openBalance を作成します。 openBalanceDouble 型です。
  7. 終了」をクリックします。
  8. ステップ 6 を繰り返して CMP EJB AccountOwner を作成します。
    1. ssn を作成します。 ssnString 型で、キー・フィールドです。
    2. name を作成します。 nameString 型です。
    3. address を作成します。 addressString 型です。
    4. phone を作成します。 phoneString 型です。
  9. Account と AccountOwner の間に 1 対多の関係を作成できます。
    1. 右のパネルの「Beans」タブをクリックします。
    2. Beans」リストから「Account」を選択します。
    3. Relationships」リストまでスクロールダウンし、「追加」をクリックします。
    4. Account」および「AccountOwner」をソース EJB として選択します。
    5. 次へ」をクリックします。
    6. 役割アカウントの「Multiplicity」で「Many」を選択し、役割アカウントの「cascade delete」を選択します。 その他はデフォルトのままにしておきます。
    7. 終了」をクリックします。



Related concepts
WSAD のプロキシー・データ・ソース・サポートを使用したアプリケーションの開発

Task topic    

Terms of Use | Feedback Last updated: Mar 20, 2006 12:35:11 PM EST
http://publib.boulder.ibm.com/infocenter/wxdinfo/v6r0/index.jsp?topic=?topic=/com.ibm.websphere.xd.doc/info/WPF51/twpentityejb.html

© Copyright IBM 2005, 2006. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)