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