The following is a quick checklist of “gotchas” to help you with your implementation:
If the primary key is composite, a custom primary key class must be defined. The fields of this class must be public and must correspond in name and type to cmp-fields of the bean class.
cmp-field and cmr-field fields must begin with a lowercase letter, (so that it can be capitalized in the corresponding getter and setter method names).
If a collection is returned from a cmr-field's getter method, it must not be modified other than through Iterator.remove() (see EJB specification, section 10.3.6.1).
Collections returned by getter methods cannot be used outside of the transaction context in which they were materialized.
If a bean has no relationships, the ...