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.