Rename property PersistenceUnitName to Name
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache JDO Project > Rename property PersistenceUnitName to Name




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Rename property PersistenceUnitName to Name  
Craig L Russell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 06:11 AM






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Christian Ernst


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 06:11 AM

Craig L Russell wrote:
> It seems that we added PersistenceUnitName to the
> PersistenceManagerFactory before completely understanding the usage,
> which primarily is to assign a name when configuring the PMF via
> jdoconfig.
>
> I now believe that the "PersistenceUnit" part of the property name is
> distracting, and the real property name should be simply "Name". That
> is, PersistenceManagerFactories can have a Name property. The javadoc
> and other documentation can call out that this name is the same as the
> PersistenceUnit name in JPA, but I don't think that there is value in
> calling it PersistenceUnitName.
>
> The implication is a change in the PersistenceManagerFactory API and
> the jdoconfig xsd.
>
> Any comments?
That sounds good.

I would like again to introduce the idea that we also add such a name
property to the
PersistenceManager and that we add a getPersistenceManagerByName(String
aName)
to the PersistenceManagerFactory.

cheers
Christian

--
Christian Ernst
Software Engineer

Tel: +49-40-60990 338
Fax: +49-40-60990 113
EMail: cernst@versant.com

Versant GmbH
Wiesenkamp 22b
22359 Hamburg
Germany

Think Outside the Grid!
http://www.versant.com

Versant GmbH is incorporated in Germany.
Company registration number: HRB 54723, Amtsgericht Hamburg.
Registered Office: Wiesenkamp 22b, 22359 Hamburg, Germany.
Geschäftsführer: Jochen Witte







[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Matthew T. Adams


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 06:11 AM

I agree.  There is no need to be so verbose, and the concept of a persistenc
e unit was and is fully embodied by JDO's PersistenceManagerFactory.  The on
ly new concept, IMHO, is to name it, and "name" is sufficient to capture thi
s.  Can you enter a JIRA fo
r this and I'll make a patch?

----- Original Message ----
From: Craig L Russell <Craig.Russell@sun.com>
To: JDO Expert Group <jdo-experts-ext@sun.com>; Apache JDO project <jdo-dev@
db.apache.org>
Sent: Tuesday, June 5, 2007 5:46:19 PM
Subject: Rename property PersistenceUnitName to Name


It seems that we added PersistenceUnitName to the
PersistenceManagerFactory before completely understanding the usage,
which primarily is to assign a name when configuring the PMF via
jdoconfig.

I now believe that the "PersistenceUnit" part of the property name is
distracting, and the real property name should be simply "Name". That
is, PersistenceManagerFactories can have a Name property. The javadoc
and other documentation can call out that this name is the same as
the PersistenceUnit name in JPA, but I don't think that there is
value in calling it PersistenceUnitName.

The implication is a change in the PersistenceManagerFactory API and
the jdoconfig xsd.

Any comments?

Craig

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Matthew T. Adams


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 06:11 AM

While I kind of see your point (but not fully yet), I don't think this is s=
omething that we should standardize, given that yours is the only implement=
ation that I've encountered with this funtionality.  Thoughts?  Can you exp=
ound on its use, please?=0A=0A----- Original Message ----=0AFrom: Christian=
Ernst <cernst@versant.com>=0ATo: Craig L Russell <Craig.Russell@sun.com>=
=0ACc: JDO Expert Group <jdo-experts-ext@sun.com>; Apache JDO project <jdo-=
dev@db.apache.org>=0ASent: Tuesday, June 5, 2007 8:50:00 PM=0ASubject: Re: =
Rename property PersistenceUnitName to Name=0A=0A=0ACraig L Russell wrote:=
=0A> It seems that we added PersistenceUnitName to the =0A> PersistenceMana=
gerFactory before completely understanding the usage, =0A> which primarily =
is to assign a name when configuring the PMF via =0A> jdoconfig.=0A>=0A> I =
now believe that the "PersistenceUnit" part of the property name is =0A> di=
stracting, and the real property name should be simply "Name". That =0A> is=
, PersistenceManagerFactories can have a Name property. The javadoc =0A> an=
d other documentation can call out that this name is the same as the =0A> P=
ersistenceUnit name in JPA, but I don't think that there is value in =0A> c=
alling it PersistenceUnitName.=0A>=0A> The implication is a change in the P=
ersistenceManagerFactory API and =0A> the jdoconfig xsd.=0A>=0A> Any commen=
ts?=0AThat sounds good.=0A=0AI would like again to introduce the idea that =
we also add such a name =0Aproperty to the=0APersistenceManager and that we=
add a getPersistenceManagerByName(String =0AaName)=0Ato the PersistenceMan=
agerFactory.=0A=0Acheers=0AChristian=0A=0A-- =0AChristian Ernst=0ASoftware =
Engineer=0A=0ATel: +49-40-60990 338=0AFax: +49-40-60990 113=0AEMail: cernst=
@versant.com=0A=0AVersant GmbH=0AWiesenkamp 22b=0A22359 Hamburg=0AGermany=
=0A=0AThink Outside the Grid!=0Ahttp://www.versant.com=0A=0AVersant GmbH is=
incorporated in Germany.=0ACompany registration number: HRB 54723, Amtsger=
icht Hamburg.=0ARegistered Office: Wiesenkamp 22b, 22359 Hamburg, Germany.=
=0AGesch=E4ftsf=FChrer: Jochen Witte






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Andy Jefferson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 06:11 AM

> I now believe that the "PersistenceUnit" part of the property name is
> distracting, and the real property name should be simply "Name". That
> is, PersistenceManagerFactories can have a Name property. The javadoc
> and other documentation can call out that this name is the same as
> the PersistenceUnit name in JPA, but I don't think that there is
> value in calling it PersistenceUnitName.

So now we would only have the "named PMF" specified via a PMF property to=20
support and implementations wouldn't be required to support reading of JPA=
=20
"persistence.xml" ?=20
I thought the general idea was to have more read-across between JPA and JDO=
-=20
ok having a "named PMF" does have its equivalent in JPA clearly, but users=
=20
can't then just take an existing "persistence.xml" file and a=20
<persistence-unit> contained within it and use it under JDO. Or maybe I=20
misunderstand your proposal


=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Andy Jefferson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-06-07 12:11 PM

On 6 June  2007 07:04, Andy Jefferson wrote: 
>
> So now we would only have the "named PMF" specified via a PMF property to
> support and implementations wouldn't be required to support reading of JPA
> "persistence.xml" ?
> I thought the general idea was to have more read-across between JPA and J=
DO
> - ok having a "named PMF" does have its equivalent in JPA clearly, but
> users can't then just take an existing "persistence.xml" file and a
> <persistence-unit> contained within it and use it under JDO. Or maybe I
> misunderstand your proposal

Or maybe you intend that an implementation supports both, and that the same=
=20
name is used for both. But in that case how does the implementation know=20
which it should go for ? What if a named PMF *and* a named "persistence-uni=
t"=20
exists for the supplied name - does "jdo.xml" take precedence over=20
"persistence.xml", or vice-versa?


=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Craig L Russell


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-07-07 12:11 AM






[ Post a follow-up to this message ]



    Re: Rename property PersistenceUnitName to Name  
Andy Jefferson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-07-07 12:11 PM

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).
 
>
> 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)






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:57 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register