The postPersist event occurs for an entity after the entity has been made
persistent. It will be invoked after the database insert operations. Generated
primary key values are available in the postPersist event.

The postPersist event occurs for an entity after the entity has been made
persistent. It will be invoked after the database insert operations. Generated
primary key values are available in the postPersist event.

The onFlush event occurs when the EntityManager#flush() operation is invoked,
after any changes to managed entities have been determined but before any actual
database operations are executed. The event is only raised if there is actually
something to do for the underlying UnitOfWork. If nothing needs to be done, the
onFlush event is not raised.

The onFlush event occurs when the EntityManager#flush() operation is invoked,
after any changes to managed entities have been determined but before any actual
database operations are executed. The event is only raised if there is actually
something to do for the underlying UnitOfWork. If nothing needs to be done, the
onFlush event is not raised.