openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <curti...@gmail.com>
Subject Re: Setter not working for detached object
Date Fri, 04 Dec 2009 15:42:40 GMT
Tao -

Can you post a simple testcase demonstrating the problem?

-- 
Thanks,
Rick

On Thu, Dec 3, 2009 at 3:38 PM, Javatao <taolu2000@gmail.com> wrote:

>
> Hi, Experts,
>
> I am having an issue with detached object in OpenJPA.
>
> Setter method of relationship field does not work.
> Setter method of primitive field works fine.
>
> Here is an example
> =======================================
> ...
> Foo foo = entityManager.find(Foo.class, 1);
> Bar foo = entityManager.find(Bar.class, 2);
> ...
> entityManager.close();
> ...
>
>
> foo.setName("newNameFoo");
> bar.setName("newNameBar");
> foo.setBar(bar);
> System.out.println(foo.getName());
> System.out.println(bar.getName());
> System.out.println(foo.getBar());
> =====================
>
> Here is the output:
>
> newNameFoo
> newNameBar
> null
>
>
> This is so wierd!
>
> Any idea?
>
> Many thanks in advance!
>
> Tao
>
>
> --
> View this message in context:
> http://n2.nabble.com/Setter-not-working-for-detached-object-tp4109048p4109048.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message