Coffee Cram: Mock Exam Answers

  1. What’s true for a bean provider when creating an entity bean using container-managed persistence? (Choose all that apply.)

    A.

    Container-managed 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.

    - Only Collection or Set can be used

    D.

    Accessor methods for container-managed relationship fields must be exposed in the bean’s remote component interface.

  2. Which of the following is a legal accessor method for a persistent field in an entity bean with container-managed persistence? (Choose all that apply.)

    A.

    public getCustomerNum();

    B.

    public void getCustomerNum();

    - It must be “public abstract” and return the value of whatever the field is... it IS after all, a GETTER.

    C.

    abstract void getCustomerNum(); ...

Get Head First EJB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.