This figure shows the life cycle of an EJB 3.0 entity. There are five states: does not exist, new, managed, detached, and removed. To transition from the does not exist state to the new state, the following occurs: plain old Java object construction occurs such as Object obj = new Object(). To transition from the new state to the managed state, the following occurs: EntityManager method persist is invoked with the new object as argument, the entity method annotated as PrePersist (if any) is invoked, the database insert completes, the entity method annotated as PostPersist (if any) is invoked. To transition from the managed state to the detached state, the following occurs: the entity is serialized to another tier. To transition from detached back to managed, the following occurs: the entity is de-serialized, the EntityManager method merge is invoked with the entity object as argument. While in the managed state, within a transactional context, you can execute an update query on the entity or use the entity public API: when the transaction commits, the following occurs: the entity method annotated as PreUpdate (if any) is invoked, the database update completes, the entity method annotated as PostUpdate (if any) is invoked. Also while in the managed state, within a transactional context, to refresh the entity, the following occurs: EntityManager method refresh is invoked with the entity object as argument, the database fetch completes, and the entity method annotated as PostLoad (if any) is then invoked.