This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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
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.