Is there any event that occurs after an entity is loaded? My goal is to add this entity to a Solr or Lucene index. The EmptyInterceptor OnLoad event occurs BEFORE an object is initialized. I want to handle an event AFTER the object properties are set. Is it possible with Hibernate Interceptors or with something else?
Asked
Active
Viewed 4,191 times
1 Answers
5
@PostLoad
seems to do the job (see community documentation). If you annotate a method with this inside your entity, it should be triggered after the entity has been loaded.

Magnilex
- 11,584
- 9
- 62
- 84
-
I don't have access to entities classes (they are in core, my code is in a module). Sorry, I didn't mention this. – DraggonZ Jul 05 '13 at 11:05
-
@DraggonZ Maybe you should edit your question with this? As your question is now, my answer is valid. If you edit your question, I will delete this answer. – Magnilex Aug 19 '13 at 12:41