Hi,

I'm switching from Toplink to Hibernate using JPA/EJB3 and Annotations.
I'm facing a problem with this change due to the fact that when I try to
persist new entities Hibernate throws a "PersistenceObjectException:
Detached entity passed to persist". Hibernate expects new entities with ID =
NULL and my new entities reach the hibernate layer with ID = 0.

If I were using hibernate xml config files (hbm.xml) I could use
"unsaved-value = 0" (for each entity), but I'm using Annotations and there's
no "unsaved-value" annotation to use.

So, anyone reach this problem? How could I change the default configuration
in Hibernate so new entities with ID = 0 will be considered as the default.

Or maybe there's a way in FDS2 to configure default value to null?

Thanks for any light on this :)

C.




--
::| Carlos Rovira
::| http://www.carlosrovira.com
::| http://www.madeinflex.com

Reply via email to