db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: Rename property PersistenceUnitName to Name
Date Thu, 07 Jun 2007 07:54:42 GMT
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 
"persistenceUnitName" then JPOX will parse any persistence.xml (in the JPA 
location(s)) for a persistence-unit of that name. With the persistence-unit 
info it will take the properties specified in the persistence-unit and append 
on any others passed in to the PMF construction (in the same way as it is 
done for an EMF with JPA). It will also internally load up the MetaData for 
all classes specified by the persistence-unit (effectively removing the need 
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 
concepts maybe there are differences in behaviour of the implementation if 
its a persistence-unit, or if its a named PMF.


Regards
-- 
Andy  (Java Persistent Objects - http://www.jpox.org)

Mime
View raw message