Ognjen Blagojevic wrote:
>
> Edmond M. wrote:
> ...
>> I've been facing the same kind of problem ; my program keeps complaining
>> about "unmanaged object" despite using EntityManager.getReference() as
>> suggested by Patrick. I wonder what I've been doing wrong. Would you show
>> the piece of code (and possibly the related configuration part in
>> orm.xml)
>> that made your program run ?
>
> This is really an old thread. :)
>
> Something like:
>
> em.getTransaction().begin();
> Child c = new Child();
> c.setName("Bob");
> c.setParent(em.getReference(Parent.class, 123););
> em.persist(predmet);
> em.getTransaction().commit();
>
> should work. More or less, thats what I'm doing. Maybe you could post
> your code, and exact stack trace?
>
> Regards,
> Ognjen
>
>
Your example helps; thank your very much.
regards !
Edmond/
--
View this message in context:
http://n2.nabble.com/How-to-PERSIST-object-without-loading-references--tp210631p735807.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.