Hibernate JPA Callbacks

Hibernate JPA Callbacks


JPA also defines a more limited set of callbacks through annotations.

Callback annotations

Type

@PrePersist
Executed before the entity manager persist operation is actually executed or cascaded. This call is synchronous with the persist operation.

@PreRemove
Executed before the entity manager remove operation is actually executed or cascaded. This call is synchronous with the remove operation.

@PostPersist
Executed after the entity manager persist operation is actually executed or cascaded. This call is invoked after the database INSERT is executed.

@PostRemove
Executed after the entity manager remove operation is actually executed or cascaded. This call is synchronous with the remove operation.

@PreUpdate
Executed before the database UPDATE operation.

@PostUpdate
Executed after the database UPDATE operation.

@PostLoad
Executed after an entity has been loaded into the current persistence context or an entity has been refreshed.

Comments

Popular posts from this blog

I get wrong characters when retreiving the message body of an email using TIdIMAP4.UIDRetrieveTextPeek2()

How to drop the all the 1's in a correlation matrix

Today Walkin 14th-Sept