What's true for a bean provider when creating an entity bean using container-managed persistence?
A. Container-manager persistent fields must be defined in the entity bean class.
B. Container-managed relationship fields must be defined in the entity bean class
C. When implementing a one-to-many relationship, the java.util.List interface must not be used
D. Accessor methods for container-managed relationship fields must be exposed in the bean's remote component interface
First of all, this was the Coffe Cream exam of chapter 6 of HF, and relationshiops weren't explained, so how could someone answer correctly regarding B and D?
Secondly, as per specs, chapter 14.1.1:
The EJB 1.1 entity Bean Provider is responsible for using the cmp-field elements of the deployment
descriptor to declare the instance�s fields that the Container must load and store at the defined
times. The fields must be defined in the entity bean class as public, and must not be defined as
The container is responsible for transferring data between the entity bean�s instance variables and the
For this reason, to me answer A would be correct (although someone could say, it should say that the correct answer was: in the entity bean class AND in the DD (ok, if this is the case, but can the authors or someone like Valentine help me on this...And other doubts on this chapter...As I've done 5 mistakes on 18 questions, and this is not good)
Because I've already read the CMR chapter, it's also true that CMR fields should be declared in the entity bean class (but, if for the same reason as above: read...'Also in the DD' this was an error, it's ok to me), to me answer B could also be true.
Answer C is correct (but how could anyone know before reading the relationships chapter???)
For the same reason as C, how could anyone know that D was incorrect, as CMR should be exposed only in local interfaces?
*edit: spec 10.3
[ August 07, 2004: Message edited by: Ryan Wong ]
Originally posted by Vijaya Laxmi:
There are mistakes in many mock exams everywhere.So better refer spec.Dont get confused in the last moment.So better know that there are mistakes and Just refer spec for your right ans with that in the spec.
Thank you Vijaya. I read that you recently passed the exam, and that you suggested to look at other resources for EJB-QL and...What was the other thing? Could you suggest where to focus my attention in the specs? I'll have a go and read all the specs, but I wouldnt' rather study all of them.