• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMR in CMP Entity Beans

 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
We could define a relationship between cmp entity beans, say one to many relationship. Lets say, Orders could have many LineItems but each LineItems could only belongs to an Orders. Set the relationship tag in ejb-jar.xml
The Orders bean would have methods like say, for example,
public abstract Collection getLineItems();
public abstract void setLineItems(Collection);
and the LineItems bean would have methods like say again for example,
/*remote*/
public abstract Orders getOrders();
public abstract void setOrders(Orders orders);
or it could be like below for local
/*local*/
public abstract LocalOrders getOrders();
public abstract void setOrders(LocalOrders localOrders);

I am a bit confused. How does the container knows which mode the local or remote to be returned in the case of the Orders bean. And in the case of the LineItems bean, the Collection returned, how is one supposed to know if the collection is made up of local or remote interfaces?
Or am I all wrong such that only local interfaces are allowed when realtionship are concerned in CMP entity beans?
Please advice. Any ideas and comments are welcomed. Thanks in advance.
Cheers
Ras
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Relations are only supported for local interfaces
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Pradeep,
Is relationship only supported in local, is it starting from j2ee1.3 and ejb2.0?
Regards
Rastin
 
Kalpesh Soni
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as fas as possible user local interfaces with entity beans!
and I think, for unidirectional relationship, local interfaces are not a must
anybody ? comment
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
TO quote from ejb spec
"Container-managed relationships
can exist only among entity beans within the same local relationship
scope, as defined by the relationships element in the deployment descriptor. Container-managed
relationships are defined in terms of the local interfaces of the related beans."
If I am not wrong BEA weblogic server 7.0 supports relationships for remote interfaces.
Future versions of EJB may also support this feature.
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think there's much of a chance that later EJB versions will support remote relationships. The semantics of how to handle cache scoping across JVM boundaries is tricky to say the least.
Kyle
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic