Multiple choice java

The persistence of Person and Address information in an application is implemented via BMP entity beans. Each Person must have exactly one Address. If a Person contains the primary key for Address in a persistent field, how should you implement the Person

  1. The ejbRemove() method of Person invokes the remove() method of Address.

  2. The ejbStore() method of Person invokes the ejbStore() method of Address.

  3. The ejbPassivate() method of Person invokes the ejbPassivate() method of Address.

  4. The ejbLoad() method of Person invokes the findByPrimaryKey() method of Address-Home.

  5. The ejbLoad() method of Person invokes the ejbLoad() method of Address.

Reveal answer Fill a bubble to check yourself
A,E Correct answer
Explanation

In BMP with 1:1 composition, the Person must cascade delete to Address. This is implemented by having Person.ejbRemove() call Address.remove(). Additionally, Person.ejbLoad() must invoke Address.ejbLoad() to synchronize the dependent Address bean's state when Person is loaded, maintaining referential integrity.