users@glassfish.java.net

Re: Can JPA cope with a dynamic schema?

From: <glassfish_at_javadesktop.org>
Date: Fri, 01 Jun 2007 08:18:29 PDT

Hi Phil,

Not sure why you would want to dynamically create tables etc - any DBA would cringe at the thought. But dynamically adding classes will wreak havoc on your JVM scallablility - potentially each row could require its own class to be loaded as well as the data from the database. That, and accessing anything different on these 'dynamic' classes will require your entire application to use reflective calls to get any of the non-standard attributes..

The wiki you outline isn't advocating that solution to this problem - it seems to be advocating a single static class. The class would hold all the attributes common to all issue/task types as well as a map containing the dynamic ones. This version of JPA would require the map to reference a separate entity class as a 1-M relation since it currently doesn't support simple collection types.

Best of luck
Chris
[Message sent by forum member 'chris_delahunt' (chris_delahunt)]

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