Hi,
I am currently working on a integration of Hibernate-Search for any JPA you possibly want. And now I am experiencing extremely different behaviour of Hibernate and EclipseLink in how the events get distributed.
As I am using EclipseLink in the project I need this Hibernate-Search-JPA integration for I naturally started implementing my unit tests and code against that and thought that other JPA implementors would behave the same. Apparently the JPA specification is not detailed enough when it comes to events.
I am talking about how the JPA events for @PostUpdate/@PreUpdate/... are being raised. In my unit test (see link below) EclipseLink raises an update on the entity which has the Sorcerer-List in it and I can update my index accordingly via my EventListeners. But with Hibernate no event is raised when I change the collection.
https://github.com/Hotware/Hibernate-Search-JPA/blob/master/hibernate-search-jpa/src/test/java/com/github/hotware/lucene/extension/hsearch/jpa/IntegrationTest.java#L271
Is this behaviour expected or is this a bug? The JPA specification doesn't talk that much about this exact behaviour:
"Is used to specify callback methods for the corresponding lifecycle event. This annotation may be applied to methods of an entity class, a mapped superclass, or a callback listener class."
I think I can live with implementing a specific Hibernate-Listener (how Hibernate-Search-ORM does it), but I would still like to know whether this is the expected behaviour or not.
|