[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[jfriends-ml 11192] Re: 「 EJB デザインパターン」読書会議事録 ( 5/22 日)



  高橋(智)です。

  Entity Bean の PrimaryKeyクラス に関して、EJB2.0のSpecでは次のように
決まっております。以下、抜粋して引用します。
----- ejb-2_0-fr-spec.pdf より -----------------------------
10.6.13 Entity bean's primary key class
 The Bean Provider must specify a primary key class in the deployment
 descriptor.
 The primary key type must be a legal Value Type in RMI-IIOP.
 The class must provide suitable implementation of the hashCode() and
 equals(Object other) methods to simplify the management of the primary
 keys by the Container.

10.8.2 Primary key that maps to multiple fields in the entity bean class
 The primary key class must be public, and must have a public constructor
 with no parameters.
 All fields in the primary key class must be declared as public.
 The names of the fields in the primary key class must be a subset of the
 names of the container-managed fields. (This allows the container to extract
 the primary key fields from an instance's container-managed fields,
 and vice versa.)

12.2.12 Entity bean's primary key class
 The Bean Provider must specify a primary key class in the deployment
 descriptor.
 The primary key type must be a legal Value Type in RMI-IIOP.
 The class must provide suitable implementation of the hashCode() and
 equals(Object other) methods to simplify the management of the primary
 keys by client code.
------------------------------------------------------------

nemo_kaz wrote:
snip 
> ■EJB開発者向けのJDO利用ガイド
>  ○equals() とhashcode()も常に入れておくのは、お作法。
snip 

-- 
高橋智宏
  Java読書会( http://www.javareading.com/bof/ )