Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about Entity EJB Relationship, CMR field

 
sanjivcts singh
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the HFE it is mentioned that if two ejb's have some relation with each other, then the abstract method in one Bean class should only return the Local Component Interface of the other class.

So my question is, why is it neccessary to return only the local component interface(or a collection of local component interface) from a abstract method(representing the CMR field) in the bean class?

thanx,
sanjiv
scjp, scwcd.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is a requirement. Section 10.3 of the spec states:

An entity bean accesses related entity beans by means of the accessor methods for its container-managed relationship fields, which are specified by the cmr-field elements of its abstract persistence schema defined in the deployment descriptor. Entity bean relationships are defined in terms of the local interfaces of the related beans, and the view an entity bean presents to its related beans is defined by its local home and local interfaces. Thus, an entity bean can be the target of a relationship from another entity bean only if it has a local interface.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic