Return-Path: Delivered-To: apmail-openjpa-users-archive@locus.apache.org Received: (qmail 32785 invoked from network); 26 Feb 2008 18:29:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2008 18:29:58 -0000 Received: (qmail 27909 invoked by uid 500); 26 Feb 2008 18:29:53 -0000 Delivered-To: apmail-openjpa-users-archive@openjpa.apache.org Received: (qmail 27883 invoked by uid 500); 26 Feb 2008 18:29:52 -0000 Mailing-List: contact users-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@openjpa.apache.org Delivered-To: mailing list users@openjpa.apache.org Delivered-To: moderator for users@openjpa.apache.org Received: (qmail 89330 invoked by uid 99); 26 Feb 2008 18:17:15 -0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Message-ID: <47C45794.5090207@cmu.edu> Date: Tue, 26 Feb 2008 13:16:52 -0500 From: Andy Schlaikjer User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: users@openjpa.apache.org Subject: Re: Dynamic Persistence Unit in SE References: <47C142A0.7030501@jyvy.net> <7262f25e0802260933s7d300581g43713cf08d60002f@mail.gmail.com> <47C45016.8000708@cs.cmu.edu> <7262f25e0802261007m2ea0a60eo3992c0f6540864e1@mail.gmail.com> In-Reply-To: <7262f25e0802261007m2ea0a60eo3992c0f6540864e1@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org It's actually a bit easier for me to describe the database schema than the api, so I'll start with that; I'd like a primary entity table to store all "fixed" fields for the entity, along with primary key. Any "dynamic" entity fields would generate separate tables which might look like: Table name: _ Column 1: foreign key to entity table Column 2: field value Column 2 type: defined in terms of field type (indices defined as needed) Of course, if the dynamic field type were something more complex than a basic type, then this organization would have to be extended somehow.. Andy Patrick Linskey wrote: > Can you describe what you're looking for in more detail, both in terms > of the database schema and the Java APIs? > > -Patrick > > On Tue, Feb 26, 2008 at 9:44 AM, Andy Schlaikjer wrote: >> On a somewhat related note, I'm interested in using column stores for >> entities with arbitrary, typed attributes, but not sure how I might >> structure this in JPA. Any thoughts? >> >> Andy >> >> >> >> Patrick Linskey wrote: >> > Hi, >> > >> > In Java SE, this is trivial: simply do not list persistent types, >> > jars, or mapping files in your persistence.xml file. Dynamic class >> > loading is discussed in the docs [1]. >> > >> > It would be nice to add an API to register new classes even when other >> > types are listed in persistence.xml; the underlying capability exists, >> > but the product does not have such an explicit API. >> > >> > -Patrick >> > >> > [1] http://openjpa.apache.org/docs/latest/manual/ref_guide_pc.html#ref_guide_pc_pcclasses >> > >> > On Sun, Feb 24, 2008 at 2:10 AM, cws wrote: >> >> brief: I want to add an unknown entity to my running PU in JavaSE. >> >> >> >> My JavaSE client app needs to load new, unknown entities (classes, not >> >> objects) from a trusted URLClassLoader. I would like to add these new >> >> entities to the existing PU, but this doesn't seem possible in SE >> >> without changing the persistence.xml and restarting. As a kludge I can >> >> send a persistence.xml with the class and create a new PU, but that >> >> doesn't allow interaction with unknown entities in the existing PU. >> >> >> >> I believe the spec requires all classes to be known at start, but I'm >> >> hoping OpenJPA or something else has implemented this dynamic >> >> feature(?). Are there any established workarounds for the client here? >> >> > > >