Re: Code organization

2009-06-08 Thread Daryl Stultz
On Mon, Jun 8, 2009 at 2:04 PM, Michael Dick wrote: > > There's no performance advantage to @NamedQueries. Well that pretty much settles if for me, thanks. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc. http://www.6degrees.com mailto:da...@6degr

Re: Code organization

2009-06-08 Thread Michael Dick
> > Set Mappings, etc and register them with the persistence >> > > > engine? I.e. is there any alternative to >> > > > using annotations/xml for defining these things? >> > > > >> > > > String query = "select o..."; >> > > > NamedQuery nq = new NamedQuery(query); >> > > > Persistence.registerNamedQuery(nq); >> > > > >> > > > Thanks. >> > > > >> > > > -- >> > > > Daryl Stultz >> > > > _ >> > > > 6 Degrees Software and Consulting, Inc. >> > > > http://www.6degrees.com >> > > > mailto:da...@6degrees.com >> > > > >> > > > >> > > >> > > >> > > - >> > > Pinaki Poddar http://ppoddar.blogspot.com/ >> > > >> > > http://www.linkedin.com/in/pinakipoddar >> > > OpenJPA PMC Member/Committer >> > > JPA Expert Group Member >> > >> > > > > -- View this message in context: http://n2.nabble.com/Code-organization-tp3030386p3044586.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Re: Code organization

2009-06-08 Thread Michael Dick
On Mon, Jun 8, 2009 at 9:36 AM, Daryl Stultz wrote: > On Fri, Jun 5, 2009 at 5:47 PM, Michael Dick >wrote: > > > I think the query isn't compiled until the first time you use it and then > > it's cached by its string form. Might have to look at that code again to > > verify though. > > ... > > >

Re: Code organization

2009-06-08 Thread Daryl Stultz
On Fri, Jun 5, 2009 at 5:47 PM, Michael Dick wrote: > I think the query isn't compiled until the first time you use it and then > it's cached by its string form. Might have to look at that code again to > verify though. ... > I don't think there's a significant performance difference between the

Re: Code organization

2009-06-08 Thread Daryl Stultz
On Fri, Jun 5, 2009 at 5:54 PM, Pinaki Poddar wrote: > > Hi Daryl, > Actually, there is an way you can externalize your queries from your Java > code. Thanks Pinaki, I might be satisfied with that. -- Daryl Stultz _ 6 Degrees Software and Consulting, Inc.

Re: Code organization

2009-06-06 Thread David Beer
Hi Mike This sort of method would certainly fit my needs and method of working more. Is there a JIRA item for this so that I can add a comment? On Fri, 5 Jun 2009 16:50:59 -0500 Michael Dick wrote: > On Fri, Jun 5, 2009 at 3:25 PM, David Beer > wrote: > > > Hi All > > > > I too would much rat

Re: Code organization

2009-06-05 Thread Pinaki Poddar
s a return of a collection of NamedQueries or something? > > -- > Daryl Stultz > _ > 6 Degrees Software and Consulting, Inc. > http://www.6degrees.com > mailto:da...@6degrees.com > > - Pinaki Poddar http://p

Re: Code organization

2009-06-05 Thread Michael Dick
On Fri, Jun 5, 2009 at 3:25 PM, David Beer wrote: > Hi All > > I too would much rather see @NamedQuery(ies) defined in a seperate > class like I do other more complicated queries. I also see this as a > good way of keeping things modular or decoupled from the model. > > Using a seperate java class

Re: Code organization

2009-06-05 Thread Michael Dick
On Fri, Jun 5, 2009 at 3:12 PM, Daryl Stultz wrote: > On Fri, Jun 5, 2009 at 3:51 PM, Michael Dick >wrote: > > > Maybe I'm misunderstanding the use case, but the real coupling is the > named > > queries to persistence.xml (persistence unit) - not necessarily the > > compilable unit. > > > This i

Re: Code organization

2009-06-05 Thread David Beer
Hi All I too would much rather see @NamedQuery(ies) defined in a seperate class like I do other more complicated queries. I also see this as a good way of keeping things modular or decoupled from the model. Using a seperate java class which then registers those queries at run time would be a good

Re: Code organization

2009-06-05 Thread Daryl Stultz
On Fri, Jun 5, 2009 at 3:51 PM, Michael Dick wrote: > Maybe I'm misunderstanding the use case, but the real coupling is the named > queries to persistence.xml (persistence unit) - not necessarily the > compilable unit. This is the case for me. In my pre-JPA world I have a Widget model class and

Re: Code organization

2009-06-05 Thread Michael Dick
Alternatively you could just include a MappedSuperclass that holds the query annotations in your persistence context. No need for a property, but you have to make sure the MappedSuperclass is part of the PersistenceUnit (add to classes in persistence.xml, specify via openjpa.MetaDataFactory=jpa(Typ

Re: Code organization

2009-06-05 Thread Donald Woods
Pinaki Poddar wrote: Hi Daryl, This is one feature, for a long time, I am interested to be included in JPA or at least in OpenJPA. Having your queries *only* in the major compilation unit is a poor idea for usability point of view and takes away much of the power from tuning a query a posterio

Re: Code organization

2009-06-05 Thread Daryl Stultz
On Fri, Jun 5, 2009 at 11:33 AM, Pinaki Poddar wrote: > > > However, I had considered the facility slightly differently than yours. Naturally, since you're a JPA expert and I'm just a lowly beginner... I was just putting out a "sketch" to help folks understand what I was after. > > The primar

Re: Code organization

2009-06-05 Thread Pinaki Poddar
.com > mailto:da...@6degrees.com > > - Pinaki Poddar http://ppoddar.blogspot.com/ http://www.linkedin.com/in/pinakipoddar OpenJPA PMC Member/Committer JPA Expert Group Member -- View this message in context: http://n2.nabble.com/Code-organization-tp3030386p3031038.html Sent from the OpenJPA Users mailing list archive at Nabble.com.

Code organization

2009-06-05 Thread Daryl Stultz
Hello, I'm frustrated by the fact that I need to define @NamedQuery and others inside my entity classes. I would like to put what I consider "logic" where I think it's appropriate which is often not with the model. Is there a way to programmatically define Named Queries Sql Result Set Mappings, et