Following is the list of callback annotations for entity bean:
-
@PrePersist - method is invoked when an entity is created in database.
-
@PostPersist - method is invoked after an entity is created in database.
-
@PreRemove - method is invoked when an entity is deleted from the database.
-
@PostRemove - method is invoked after an entity is deleted from the database.
-
@PreUpdate - method is invoked before an entity is to be updated in the database.
-
@PostLoad - method is invoked when a record is fetched from database and loaded into the entity.