geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacek Laskowski" <>
Subject Re: EntityExistsException: Attempt to persist detached object
Date Thu, 22 Nov 2007 18:58:33 GMT
On Nov 22, 2007 7:52 PM, maho77 <> wrote:

>  I have already tried em.persist(em.merge(group)). It didn't work. I the
> meantime I found out that the problem obviously lies in the @TableGenerator
> thing. I removed it and set the id by hand and it worked fine. So I hope
> your right. with the primary key.
> So only to understand it right, do I have to set the
> private int id = 0;
> by hand or is the attribute in the @TableGenerator enough. I ask because I
> tried it with private int id; which also refused to work. On monday I will
> be back in the office and try it.

I need to try it out myself too as it could be an issue with our
integration with openjpa. Anyway, don't touch primary key of the
entity as it's reserved for a jpa provider's use. Let the default
initial value be set for it.


Jacek Laskowski

View raw message