Does Axon 2.0-rc1 work with Hibernate 3.5.6

Hi Axonians

I have a project that uses Hibernate 3.5.6 and I am having some odd problems using the JpaEventStore.

After some digging I can see that events are serialised, but when I try to load an aggregate from the store I get an IllegalArgumentException with the message “Cannot create TypedQuery for query with more than one return” from the fetchBatch-method in the DefaultEventEntryStore.BatchingAggregateStreamIterator class.

I can see that the Axon pom files list Hibernate 4.1.7 as a dependency, and now I’m wondering if Axon is using JPA/Hibernate features that aren’t compatible with older versions of Hibernate.

Has anyone seen this error or know what causes it?


Hi Mads.

I investigated the problem and was able to reproduce it in my tests. It’s fixed in the latest snapshot.
It seems that Hibernate 3.5 is not able to do a query like this:
entityManager.createQuery("SELECT new some.Object(…) FROM SomeEntity e ", some.Object.class)

The “select new” and the second parameter defining the type of return value expected conflict in that version of Hibernate. In 4.1, it’s not a problem.



Thanks, it works like a charm.

Now I postpone “doing the right thing” for at least another quarter :wink: