Originally posted by Prakash Krishnamurthy:
This is a question from the mock test for IBM 484, altough the question is clear to me, i dont agree with the choices given. Any suggestions on what the answer could be.
A container-managed persistence (CMP) bean A has a one-to-many container-managed relationship (CMR) with another container-managed persistence (CMP) bean B. Select the interface that will expose the methods related to this relationship. (choose one)
A. The local interface of bean A.
B. The local home interface of bean A.
C. The remote interface of bean A.
D. The home interface of bean A.
Homes aren't involved in relationships -- how could they be? So thattakes out B and D and leaves either the remote or local interfaces.
I quote from the
EJB 2.0 spec, section 10.3.2:
"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."
And on the page prior to that:
"The accessor methods for the container-managed relationship fields must not be exposed in the remote interface of an entity bean."
So, that takes out C, leaving A. Now, I agree that if the relationship is bidirectional that there COULD be methods on bean B as well. However, it's straightforward to figure out which of the answers on the quiz is (certainly) correct.
Kyle