Hi,
I'm trying to develop a custom type in hibernate to hold i18n fields. For that purpouse, I have created a custom Hibernate UserType.The problem is that whenever I need to save my entity, I also need to perform some queries inside the nullSafeSet() method. This works pretty good if all I do is :
Code:
entityManager.merge()
but when creating a straight new entity and calling entityManager.persist() it returns the following error:
Code:
10:14:12,018 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in com.amadeus.websolutions.irmap.model.Airport entry (don't flush the Session after an exception occurs)
To create the queries inside the nullSafeSet method, I inject the Seam EntityManager component, which is basically a proxy to the entityManager. It does work when merging, not when persisting. The id field of my entity has Auto Generation.
Can someone bring some light into this? If I remove every entityManager query from my nullSafeSet() method it works, but I can't afford that.
Thank you in advance, and if you need more information, please just ask me.