users@glassfish.java.net

Re: Entity Problem (2 one-to-many, 1 many-to-one)

From: <glassfish_at_javadesktop.org>
Date: Wed, 19 Sep 2007 09:54:27 PDT

Jan,

Named query won't change anything. Did you create the entities yourself, or were they always in the database?

If it's the former, you either need to call refresh after your read it back (and set cascade=REFRESH on the relationship), or set all relationships yourself when you are creating the instances, or disable the cache. TopLink Essentials copies the entities as-is into the 2-nd level cache, so it assumes that there is nothing else in the database, if you didn't set it.

If it's the latter, we need to understand more. Is it a Java SE or a Java EE application?

thanks,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=236052