Support for hibernate 4.x

57 views
Skip to first unread message

Oliver Ringel

unread,
Mar 9, 2012, 3:32:27 AM3/9/12
to Fornax-Platform
Hi,

finally I finished and committed the support for hibernate 4.1.0
(4.0.1 is also OK).
This version is now the default.

Here are the new dependencies.

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>4.1.0.Final</version>
</dependency>

Replace net.sf.ehcache with

<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>4.1.0.Final</version>
</dependency>

There was a change in hibernate's public api that affects the handling
of usertypes,
This means hibernate 4.x is not compatible with hibernate 3.x.

I fixed our enum support internally.
In case you are using the joda date and time api replace your existing
dependencies
(joda-time and joda-time-hibernate) with

<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.jadira.usertype</groupId>
<artifactId>usertype.core</artifactId>
<version>3.0.0.CR1</version>
<exclusions>
<exclusion>
<groupId>org.joda</groupId>
<artifactId>joda-money</artifactId>
</exclusion>
</exclusions>
</dependency>

Sculptor 2.2 is backward compatible with hibernate 3.x. I added a new
jpa.provider for that reason

jpa.provider=hibernate3

If you have no need to upgrade your projects to hibernate 4.x, simply
add the above line into your
sculptor-generator.properties file.

Also the support of the maven-hibernate3-plugin to generate DDL is
broken.
I provide a solution soon (calling SchemaTool directly).

I needed to upgrade to hsqldb 2.x to get hibernate working (I guess
there is another solution, no time to discover).
hsqldb 2 stopped the support for isolation level read uncommitted for
transactions that are not read only.
ThereforeI I refactored some integration test. Tests that use a
seperate JDBC connection to select
informations (counting rows after insert, ...) and are causing locking
problems.
Now our example testcases use a cleared entitymanager within the same
transaction to get the needed informations. This is a quick fix. But I
can live with it.
For better (and real world) integration tests we have to do some more
rethinking.

Best regards,
Oliver

Patrik Nordwall

unread,
Mar 10, 2012, 10:18:59 AM3/10/12
to fornax-...@googlegroups.com
Awesome job, as usual. I have deployed it as 2.2.0-SNAPSHOT
/Patrik
Reply all
Reply to author
Forward
0 new messages