users@glassfish.java.net

Re: JPA and unknown db-schema

From: <glassfish_at_javadesktop.org>
Date: Mon, 03 Dec 2007 11:09:06 PST

Using TopLink's native metadata structures you can define Entity mappings in a SessionCustomizer before the EntityManager is first used. If you can limit access to the EntityManagers you could even alter the metadata structures on the fly by gaining access to the underlying Session object from the EntityManagerFactory logging out the Session, updating the mappings and then logging the Session back in.

You will not be able to leverage lazy XtoOne relationships but will still have lazy X to Many relationships.

Here's a link to the TopLink documentation : http://www.oracle.com/technology/products/ias/toplink/doc/index.html
Most of this information applies to TopLink essentials, just change the package names.

I understand this is a wide scoping answer but the issue description is pretty wide in scope. What are the details of how and when you need to define these entity mappings? Is it at deployment or truely 'on the fly'?
--Gordon
[Message sent by forum member 'gyorke' (gyorke)]

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