Hi Matej,
You can always consider using my pull request above. This is the same fix as originally submitted 2.5 y ago and is working perfect. Or you can even use https://github.com/syncron/hibernate-orm/commits/syncron-4.2.x
best