O'Reilly logo

Beginning Java™ EE 6 Platform with GlassFish™ 3 by Antonio Goncalves

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 5. Callbacks and Listeners

In the previous chapter, you saw how to query mapped entities. Now you know how to persist, remove, update, and find an entity by its identifier. With JPQL, you can retrieve one or more entities according to certain search criteria with dynamic, static, and native queries. All these actions are carried out by the entity manager—the central piece that manipulates entities and manages their life cycle.

I described the entity life cycle by saying that entities are managed by the entity manager (meaning that they have a persistence identity and are synchronized with the database) or are detached from the database and used as normal POJOs. But the life cycle of an entity is slightly richer. Importantly, JPA allows ...

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