O'Reilly logo

EJB 3 in Action by Derek Lane, Reza Rahman, Debu Panda

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Manipulating entities with EntityManager

This chapter covers

  • Persistence context and its scope
  • Container- and application-managed entity managers
  • Entity lifecycle and CRUD operations
  • Detachment and merge operations
  • Entity lifecycle listeners

In chapter 7 you learned how to develop the application domain model using JPA. In chapter 8 you saw how domain objects and relationships are mapped to the database. While the ORM annotations we explored in chapter 8 indicate how an entity is persisted, the annotations don’t do the actual persisting. This is performed by applications using the EntityManager interface, the topic of this chapter.

To use an analogy, the domain model annotated with ORM configuration is like a children’s toy ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required