You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by mayms <ma...@web.de> on 2009/06/19 13:25:56 UTC

modify the code to remove the initializer processing

Hello,

I'm getting a message from openjpa because I'm trying to persist an object
that already has an id. The normal case in my code is that this field is
generated but I also want to set the id on my own. How can I achieve this?
 
Message from openjpa: "This existing value was either provided via an
initializer or by calling the setter method.  You either need to remove
the @GeneratedValue annotation or modify the code to remove the
initializer processing. "

So actually my question is how can I modify the code to remove the
initializer processing.

cheers, Marcus
-- 
View this message in context: http://n2.nabble.com/modify-the-code-to-remove-the-initializer-processing-tp3119088p3119088.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Re: modify the code to remove the initializer processing

Posted by MiƂosz Tylenda <mt...@o2.pl>.
Marcus,

My guess is the term "initializer processing" refers to Java object initialization. In other words, it suggests you might have assigned a value to the id field in a constructor.

As for an idea on how to have a generated field and also be able to set it on your own, I don't know any. Maybe someone else can suggest a solution.

Cheers,
Milosz

> 
> Hello,
> 
> I'm getting a message from openjpa because I'm trying to persist an object
> that already has an id. The normal case in my code is that this field is
> generated but I also want to set the id on my own. How can I achieve this?
>  
> Message from openjpa: "This existing value was either provided via an
> initializer or by calling the setter method.  You either need to remove
> the @GeneratedValue annotation or modify the code to remove the
> initializer processing. "
> 
> So actually my question is how can I modify the code to remove the
> initializer processing.
> 
> cheers, Marcus
> -- 
> View this message in context: http://n2.nabble.com/modify-the-code-to-remove-the-initializer-processing-tp3119088p3119088.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
> 
>