Return-Path: Delivered-To: apmail-db-jdo-dev-archive@www.apache.org Received: (qmail 90672 invoked from network); 7 Jun 2007 07:55:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Jun 2007 07:55:07 -0000 Received: (qmail 19323 invoked by uid 500); 7 Jun 2007 07:55:11 -0000 Mailing-List: contact jdo-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jdo-dev@db.apache.org Delivered-To: mailing list jdo-dev@db.apache.org Received: (qmail 19303 invoked by uid 99); 7 Jun 2007 07:55:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2007 00:55:11 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [212.159.14.131] (HELO pih-relay04.plus.net) (212.159.14.131) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2007 00:55:06 -0700 Received: from [87.113.70.108] (helo=[192.168.0.25]) by pih-relay04.plus.net with esmtp (Exim) id 1HwCpP-0007tg-9i; Thu, 07 Jun 2007 08:54:43 +0100 From: Andy Jefferson To: jdo-dev@db.apache.org, JDO Expert Group Subject: Re: Rename property PersistenceUnitName to Name Date: Thu, 7 Jun 2007 08:54:42 +0100 User-Agent: KMail/1.8.2 References: <99B66C55-F978-48B1-8021-8049D9CE7AAE@SUN.com> <200706060712.52540.andy@jpox.org> <70817C14-98E5-4520-B859-1E2933ADDF9F@SUN.com> In-Reply-To: <70817C14-98E5-4520-B859-1E2933ADDF9F@SUN.com> Organization: JPOX MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200706070854.42362.andy@jpox.org> X-Virus-Checked: Checked by ClamAV on apache.org Hi Craig, > This part of the use case was not in mind when I wrote the change > request. The user asks for PMF by name "MyPMF" but then the > PersistenceUnitName in MyPMF refers to a PersistenceUnit in the > persistence.xml. > > Is that what JPOX does with the PersistenceUnitName today? JPOX current behaviour : If the user specifies a set of PMF properties and they include a=20 "persistenceUnitName" then JPOX will parse any persistence.xml (in the JPA= =20 location(s)) for a persistence-unit of that name. With the persistence-unit= =20 info it will take the properties specified in the persistence-unit and appe= nd=20 on any others passed in to the PMF construction (in the same way as it is=20 done for an EMF with JPA). It will also internally load up the MetaData for= =20 all classes specified by the persistence-unit (effectively removing the nee= d=20 to discover metadata at runtime). > > Or maybe you intend that an implementation supports both, and that > > the same > > name is used for both. But in that case how does the implementation > > know > > which it should go for ? What if a named PMF *and* a named > > "persistence-unit" > > exists for the supplied name - does "jdo.xml" take precedence over > > "persistence.xml", or vice-versa? > > Good question. Perhaps there is room for both PersistenceUnitName and > Name properties? The Name is used to match the user's > getPersistenceManagerFactory(String name) and the PersistenceUnitName > is used to match the persistence-unit name attribute in persistence.xml? I think that's what I would prefer since while they represent very similar= =20 concepts maybe there are differences in behaviour of the implementation if= =20 its a persistence-unit, or if its a named PMF. Regards =2D-=20 Andy =A0(Java Persistent Objects - http://www.jpox.org)