• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CMR in CMP Entity Beans

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Relations are only supported for local interfaces
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Pradeep,
Is relationship only supported in local, is it starting from j2ee1.3 and ejb2.0?
Regards
Rastin
 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic