Aaron Mulder wrote:
>         Just to try to review the requirements: prim-key-class is *always*
> required, and prim-key-field is required for CMP entity beans that use a
> simple primary key.
>         For CMP beans that use a complex primary key, all the fields of
> the primary key must be public and non-static.  They must have the same
> names as fields in the bean implementation class, and those fields must
> also be public and non-static.  The PK fields in the bean implementation
> must be declared as CMP Fields in ejb-jar.xml, as well.
>         You should not declare a field in the bean implementation that has
> the type of the bean's primary key - you must instead use multiple
> individual fields that correspond to the fields of the primary key, as
> above.  Or at least, if you do declare such a field, it cannot be a
> container-managed field and it does not replace the individual
> container-managed fields that are required.
>         Let's see...  Your primary key class must be serializable and
> public.  That's about all I can think off off the top of my head, but the
> spec is of course the final authority.

*LOL* You forgot to mention the "hashCode" and "equals" implementation.
;-)

I personally recommend to always use a compound key (even with just one
field) as it gives you the possibility to change it easily in the
future.

Using the EJBDoclet will give you a proper implementation of this.

/Rickard

ps. For those of you keeping scores: Marc vs Rickard: 1 - 0 :-) 

-- 
Rickard �berg

Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to