Q&A

Q1:What's the difference between a container-managed persistent field and container-managed relationship field?
A1: A persistent field is designed to represent or store a single unit of data. A relationship field is designed to represent or store a reference to another entity bean. Unlike a persistent field, a relationship field does not constitute the state of an entity bean.
Q2:How do I implement a container-managed relationship field in the entity bean class?
A2: Similar to container-managed persistent fields, container-managed relationship fields are not defined in the entity bean class and are virtual fields only. The entity bean class declares the public abstract get and set methods for each relationship field. The implementation of ...

Get Sams Teach Yourself EJB in 21 Days 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.