Re: Duplicate Query - where none exists
Hmm. I don't see anything wrong with that mapping. How is the @OneToOne on the other side of the @ManyToOne defined (if you have one)? It might be good to see the output of the mappingtool's validate action on your classes. E.g.: java org.apache.openjpa.jdbc.meta.MappingTool -action validate - Log DefaultLevel=TRACE META-INF/persistence.xml On Apr 5, 2007, at 6:02 AM, Phill Moran wrote: It is actually called categoryTypeFK and is char(45) related to ID, char(45) in categoryType table. I like the less is more but I remember getting some complaints in eclipse. I'll try again -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 5, 2007 2:42 AM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists How is the "category.categoryTypeFK" column defined in the database? An is there a corresponding "id" column in the table for the CategoryType class? Also, when there is just a single column in the join for a ManyToOne, I think you can skip setting the "referencedColumnName" attribute, since it will implicitly join to the single primary key of the related table. I.e., you should be able to do: @ManyToOne @JoinColumn(name = "categoryTypeFK") On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: I think you may be on to something and have been looking into it. It is mapped and I thought worked but I am learning that I have a pretty messed up config (I had both Toplink and OpenJPA, I am accessing fields directly not through getters and am not positive that the mapping is right as it is one to many). I have other versions of the same mapping and this fairly commonly used class for my application as it represents categories that are grouped by categoryTpye. It does have a relation into the offended query class though - Here is the pertinent parts of the Store class: @ManyToOne @JoinColumn(name = "typeFK", referencedColumnName = "id") public Category getType() throws StoreTypeNotFoundException { return type; } - Here is the pertinent parts of the Category class: @Entity @Table(name = "category", schema = "bidspec") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @NamedQueries( { @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM Category c WHERE c.type = :type"), @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c FROM Category c WHERE c.id = :primaryKey"), @NamedQuery(name = "CategoryFXDescription", query = "SELECT c FROM Category c WHERE UPPER(c.description) LIKE :description ORDER BY c.description") }) public class Category extends Persistable { ... @ManyToOne @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") public CategoryType getType() { return this.type; } Persistable is my base JPA persistable class housing the String id for all persistable classes -----Original Message----- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 4, 2007 11:13 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists Phill- While I'm not sure the cause of the duplicate query error, I do notice the original cause in the nested stack trace is: Caused by: <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: You cannot join on column "category.categoryTypeFK". It is not managed by a mapping that supports joins. It could be that this error is indirectly causing the next one. Have you looked into this? How is categoryTypeFK mapped? On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: I did a workspace search and it exists in only one place. Also if I comment out the one it complains about it complains about the next one. But only in this java file. I even did an clean and build to make sure there were no old class files hanging out. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 5:06 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarations are located. -dain On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: Anyone seen this before WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" in "class .". Ignoring. This class has only three such named queries all differe
RE: Duplicate Query - where none exists
FWIW, I think that I've seen an incorrect duplicate query warning at some point as well. -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > -Original Message- > From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On > Behalf Of Marc Prud'hommeaux > Sent: Thursday, April 05, 2007 11:24 AM > To: open-jpa-dev@incubator.apache.org > Subject: Re: Duplicate Query - where none exists > > Hans- > > I just did a query test with the > examples/hellojpa/Message.java class > in the latest openjpa-0.9.7-incubating-SNAPSHOT, and when I add: > > @NamedQueries({ > @NamedQuery(name="q1", query="select x from Message x"), > @NamedQuery(name="q1", query="select x from Message x") > }) > > I get the duplicate query warning. But when I remove one of the > queries, I get no warning. So it appears to be working as expected. > > Can you show us your class that is giving the warning, as > well as the > logging output with verbose logging enabled (i.e., setting > "openjpa.Log" to "DefaultLevel=TRACE")? > > > On Apr 5, 2007, at 12:01 AM, Hans Prueller wrote: > > > perhaps this can help out: > > > > I just started using OpenJPA and I have ONLY A SINGLE CLASS > WITHOUT > > ANY RELATIONS where I get this duplicate-query warning. So I can't > > believe that its related to that somehow... > > > > Hans > > > > Original-Nachricht > > Datum: Wed, 4 Apr 2007 23:42:01 -0700 > > Von: Marc Prud\'hommeaux <[EMAIL PROTECTED]> > > An: open-jpa-dev@incubator.apache.org > > Betreff: Re: Duplicate Query - where none exists > > > >> > >> How is the "category.categoryTypeFK" column defined in the > database? > >> > >> An is there a corresponding "id" column in the table for the > >> CategoryType class? > >> > >> Also, when there is just a single column in the join for a > ManyToOne, > >> I think you can skip setting the "referencedColumnName" attribute, > >> since it will implicitly join to the single primary key of the > >> related table. I.e., you should be able to do: > >> > >>@ManyToOne > >>@JoinColumn(name = "categoryTypeFK") > >> > >> > >> > >> > >> On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: > >> > >>> I think you may be on to something and have been looking into it. > >>> It is mapped > >>> and I thought worked but I am learning that I have a pretty messed > >>> up config (I > >>> had both Toplink and OpenJPA, I am accessing fields directly not > >>> through getters > >>> and am not positive that the mapping is right as it is one to > >>> many). I have > >>> other versions of the same mapping and this fairly commonly used > >>> class for my > >>> application as it represents categories that are grouped by > >>> categoryTpye. It > >>> does have a relation into the offended query class though > >>> > >>> - Here is the pertinent parts of the Store class: > >>> > >>> @ManyToOne > >>> @JoinColumn(name = "typeFK", referencedColumnName = "id") > >>> public Category getType() throws StoreTypeNotFoundException { > >>> return type; > >>> } > >>> > >>> - Here is the pertinent parts of the Category class: > >>> > >>> @Entity > >>> @Table(name = "category", schema = "bidspec") > >>> @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) > >>> @NamedQueries( { > >>> @NamedQuery(name = "CategoryFXType", query = > "SELECT c FROM > >>> Category c WHERE c.type = :type"), > >>> @NamedQuery(name = "CategoryValueObjectFXPK", > query = "SELECT c > >>> FROM Category c WHERE c.id = :primaryKey&qu
Re: Duplicate Query - where none exists
Hans- I just did a query test with the examples/hellojpa/Message.java class in the latest openjpa-0.9.7-incubating-SNAPSHOT, and when I add: @NamedQueries({ @NamedQuery(name="q1", query="select x from Message x"), @NamedQuery(name="q1", query="select x from Message x") }) I get the duplicate query warning. But when I remove one of the queries, I get no warning. So it appears to be working as expected. Can you show us your class that is giving the warning, as well as the logging output with verbose logging enabled (i.e., setting "openjpa.Log" to "DefaultLevel=TRACE")? On Apr 5, 2007, at 12:01 AM, Hans Prueller wrote: perhaps this can help out: I just started using OpenJPA and I have ONLY A SINGLE CLASS WITHOUT ANY RELATIONS where I get this duplicate-query warning. So I can't believe that its related to that somehow... Hans Original-Nachricht Datum: Wed, 4 Apr 2007 23:42:01 -0700 Von: Marc Prud\'hommeaux <[EMAIL PROTECTED]> An: open-jpa-dev@incubator.apache.org Betreff: Re: Duplicate Query - where none exists How is the "category.categoryTypeFK" column defined in the database? An is there a corresponding "id" column in the table for the CategoryType class? Also, when there is just a single column in the join for a ManyToOne, I think you can skip setting the "referencedColumnName" attribute, since it will implicitly join to the single primary key of the related table. I.e., you should be able to do: @ManyToOne @JoinColumn(name = "categoryTypeFK") On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: I think you may be on to something and have been looking into it. It is mapped and I thought worked but I am learning that I have a pretty messed up config (I had both Toplink and OpenJPA, I am accessing fields directly not through getters and am not positive that the mapping is right as it is one to many). I have other versions of the same mapping and this fairly commonly used class for my application as it represents categories that are grouped by categoryTpye. It does have a relation into the offended query class though - Here is the pertinent parts of the Store class: @ManyToOne @JoinColumn(name = "typeFK", referencedColumnName = "id") public Category getType() throws StoreTypeNotFoundException { return type; } - Here is the pertinent parts of the Category class: @Entity @Table(name = "category", schema = "bidspec") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @NamedQueries( { @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM Category c WHERE c.type = :type"), @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c FROM Category c WHERE c.id = :primaryKey"), @NamedQuery(name = "CategoryFXDescription", query = "SELECT c FROM Category c WHERE UPPER(c.description) LIKE :description ORDER BY c.description") }) public class Category extends Persistable { ... @ManyToOne @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") public CategoryType getType() { return this.type; } Persistable is my base JPA persistable class housing the String id for all persistable classes -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 4, 2007 11:13 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists Phill- While I'm not sure the cause of the duplicate query error, I do notice the original cause in the nested stack trace is: Caused by: <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: You cannot join on column "category.categoryTypeFK". It is not managed by a mapping that supports joins. It could be that this error is indirectly causing the next one. Have you looked into this? How is categoryTypeFK mapped? On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: I did a workspace search and it exists in only one place. Also if I comment out the one it complains about it complains about the next one. But only in this java file. I even did an clean and build to make sure there were no old class files hanging out. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 5:06 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarati
RE: Duplicate Query - where none exists
It is actually called categoryTypeFK and is char(45) related to ID, char(45) in categoryType table. I like the less is more but I remember getting some complaints in eclipse. I'll try again -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 5, 2007 2:42 AM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists How is the "category.categoryTypeFK" column defined in the database? An is there a corresponding "id" column in the table for the CategoryType class? Also, when there is just a single column in the join for a ManyToOne, I think you can skip setting the "referencedColumnName" attribute, since it will implicitly join to the single primary key of the related table. I.e., you should be able to do: @ManyToOne @JoinColumn(name = "categoryTypeFK") On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: > I think you may be on to something and have been looking into it. > It is mapped > and I thought worked but I am learning that I have a pretty messed up > config (I had both Toplink and OpenJPA, I am accessing fields directly > not through getters and am not positive that the mapping is right as > it is one to many). I have other versions of the same mapping and this > fairly commonly used class for my application as it represents > categories that are grouped by categoryTpye. It does have a relation > into the offended query class though > > - Here is the pertinent parts of the Store class: > > @ManyToOne > @JoinColumn(name = "typeFK", referencedColumnName = "id") > public Category getType() throws StoreTypeNotFoundException { > return type; > } > > - Here is the pertinent parts of the Category class: > > @Entity > @Table(name = "category", schema = "bidspec") @Inheritance(strategy = > InheritanceType.TABLE_PER_CLASS) @NamedQueries( { > @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM Category > c WHERE c.type = :type"), > @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c FROM > Category c WHERE c.id = :primaryKey"), > @NamedQuery(name = "CategoryFXDescription", query = "SELECT c FROM > Category c WHERE UPPER(c.description) LIKE :description ORDER BY > c.description") }) > public class Category extends Persistable { > > ... > > @ManyToOne > @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") > public CategoryType getType() { > return this.type; > } > > Persistable is my base JPA persistable class housing the String id for > all persistable classes > > -Original Message- > From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf > Of Marc Prud'hommeaux > Sent: April 4, 2007 11:13 PM > To: open-jpa-dev@incubator.apache.org > Subject: Re: Duplicate Query - where none exists > > Phill- > > While I'm not sure the cause of the duplicate query error, I do notice > the original cause in the nested stack trace is: > >> Caused by: <4|true|0.0.0> >> org.apache.openjpa.persistence.ArgumentException: You cannot join on >> column "category.categoryTypeFK". It is not managed by a mapping >> that supports joins. > > It could be that this error is indirectly causing the next one. > > Have you looked into this? How is categoryTypeFK mapped? > > > > > On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: > >> I did a workspace search and it exists in only one place. Also if I >> comment out the one it complains about it complains about the next >> one. But only in this java file. I even did an clean and build to >> make sure there were no old class files hanging out. >> >> -Original Message- >> From: Dain Sundstrom [mailto:[EMAIL PROTECTED] >> Sent: April 4, 2007 5:06 PM >> To: open-jpa-dev@incubator.apache.org >> Subject: Re: Duplicate Query - where none exists >> >> I think I saw this once. The problem is in JPA named queries are all >> contained in a single global namespace, so if you have to persistent >> beans that define queries with the same name you get a warning. It >> would be nice if the warning told you where the duplicate >> declarations are located. >> >> -dain >> >> On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: >> >>> Anyone seen this before >>> >>> WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" &
Re: Duplicate Query - where none exists
How is the "category.categoryTypeFK" column defined in the database? An is there a corresponding "id" column in the table for the CategoryType class? Also, when there is just a single column in the join for a ManyToOne, I think you can skip setting the "referencedColumnName" attribute, since it will implicitly join to the single primary key of the related table. I.e., you should be able to do: @ManyToOne @JoinColumn(name = "categoryTypeFK") On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: I think you may be on to something and have been looking into it. It is mapped and I thought worked but I am learning that I have a pretty messed up config (I had both Toplink and OpenJPA, I am accessing fields directly not through getters and am not positive that the mapping is right as it is one to many). I have other versions of the same mapping and this fairly commonly used class for my application as it represents categories that are grouped by categoryTpye. It does have a relation into the offended query class though - Here is the pertinent parts of the Store class: @ManyToOne @JoinColumn(name = "typeFK", referencedColumnName = "id") public Category getType() throws StoreTypeNotFoundException { return type; } - Here is the pertinent parts of the Category class: @Entity @Table(name = "category", schema = "bidspec") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @NamedQueries( { @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM Category c WHERE c.type = :type"), @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c FROM Category c WHERE c.id = :primaryKey"), @NamedQuery(name = "CategoryFXDescription", query = "SELECT c FROM Category c WHERE UPPER(c.description) LIKE :description ORDER BY c.description") }) public class Category extends Persistable { ... @ManyToOne @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") public CategoryType getType() { return this.type; } Persistable is my base JPA persistable class housing the String id for all persistable classes -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 4, 2007 11:13 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists Phill- While I'm not sure the cause of the duplicate query error, I do notice the original cause in the nested stack trace is: Caused by: <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: You cannot join on column "category.categoryTypeFK". It is not managed by a mapping that supports joins. It could be that this error is indirectly causing the next one. Have you looked into this? How is categoryTypeFK mapped? On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: I did a workspace search and it exists in only one place. Also if I comment out the one it complains about it complains about the next one. But only in this java file. I even did an clean and build to make sure there were no old class files hanging out. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 5:06 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarations are located. -dain On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: Anyone seen this before WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" in "class .". Ignoring. This class has only three such named queries all different names and different actual queries. See following @NamedQueries( { @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s WHERE s.id = :primaryKey"), @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR UPPER(s.displayName) = :storeName2"), @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = :storeName2") }) I even renamed the duplicate parms to make sure it was not a trickle down exception. Not only that, if I comment out the StoreFXPK query I get the same error on the next named Query. I did a search on the workspace an this is only used in one place (fa
Re: Duplicate Query - where none exists
perhaps this can help out: I just started using OpenJPA and I have ONLY A SINGLE CLASS WITHOUT ANY RELATIONS where I get this duplicate-query warning. So I can't believe that its related to that somehow... Hans Original-Nachricht Datum: Wed, 4 Apr 2007 23:42:01 -0700 Von: Marc Prud\'hommeaux <[EMAIL PROTECTED]> An: open-jpa-dev@incubator.apache.org Betreff: Re: Duplicate Query - where none exists > > How is the "category.categoryTypeFK" column defined in the database? > > An is there a corresponding "id" column in the table for the > CategoryType class? > > Also, when there is just a single column in the join for a ManyToOne, > I think you can skip setting the "referencedColumnName" attribute, > since it will implicitly join to the single primary key of the > related table. I.e., you should be able to do: > > @ManyToOne > @JoinColumn(name = "categoryTypeFK") > > > > > On Apr 4, 2007, at 8:34 PM, Phill Moran wrote: > > > I think you may be on to something and have been looking into it. > > It is mapped > > and I thought worked but I am learning that I have a pretty messed > > up config (I > > had both Toplink and OpenJPA, I am accessing fields directly not > > through getters > > and am not positive that the mapping is right as it is one to > > many). I have > > other versions of the same mapping and this fairly commonly used > > class for my > > application as it represents categories that are grouped by > > categoryTpye. It > > does have a relation into the offended query class though > > > > - Here is the pertinent parts of the Store class: > > > > @ManyToOne > > @JoinColumn(name = "typeFK", referencedColumnName = "id") > > public Category getType() throws StoreTypeNotFoundException { > > return type; > > } > > > > - Here is the pertinent parts of the Category class: > > > > @Entity > > @Table(name = "category", schema = "bidspec") > > @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) > > @NamedQueries( { > > @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM > > Category c WHERE c.type = :type"), > > @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c > > FROM Category c WHERE c.id = :primaryKey"), > > @NamedQuery(name = "CategoryFXDescription", query = "SELECT c > > FROM Category c WHERE UPPER(c.description) LIKE :description ORDER BY > > c.description") }) > > public class Category extends Persistable { > > > > ... > > > > @ManyToOne > > @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") > > public CategoryType getType() { > > return this.type; > > } > > > > Persistable is my base JPA persistable class housing the String id > > for all > > persistable classes > > > > -Original Message- > > From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On > > Behalf Of Marc > > Prud'hommeaux > > Sent: April 4, 2007 11:13 PM > > To: open-jpa-dev@incubator.apache.org > > Subject: Re: Duplicate Query - where none exists > > > > Phill- > > > > While I'm not sure the cause of the duplicate query error, I do > > notice the > > original cause in the nested stack trace is: > > > >> Caused by: <4|true|0.0.0> > >> org.apache.openjpa.persistence.ArgumentException: You cannot join on > >> column "category.categoryTypeFK". It is not managed by a mapping > >> that > >> supports joins. > > > > It could be that this error is indirectly causing the next one. > > > > Have you looked into this? How is categoryTypeFK mapped? > > > > > > > > > > On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: > > > >> I did a workspace search and it exists in only one place. Also if I > >> comment out the one it complains about it complains about the next > >> one. But only in this java file. I even did an clean and build to > >> make > >> sure there were no old class files hanging out. > >> > >> -Original Message- > >> From: Dain Sundstrom [mailto:[EMAIL PROTECTED] > >> Sent: April 4, 2007 5:06 PM > >> To: open-jpa-dev@incubator.apache.org > >> Subject: Re: Duplicate Query - where none exists
Re: RE: Duplicate Query - where none exists
I also don't think that this is related to the global namespace because I started naming my queries with class-specific prefixes, e.g. "PositionLog.findById" - and I got this warning also on those... Hans Original-Nachricht Datum: Wed, 4 Apr 2007 23:03:16 -0400 Von: "Phill Moran" <[EMAIL PROTECTED]> An: open-jpa-dev@incubator.apache.org Betreff: RE: Duplicate Query - where none exists > I did a workspace search and it exists in only one place. Also if I > comment out > the one it complains about it complains about the next one. But only in > this > java file. I even did an clean and build to make sure there were no old > class > files hanging out. > > -Original Message- > From: Dain Sundstrom [mailto:[EMAIL PROTECTED] > Sent: April 4, 2007 5:06 PM > To: open-jpa-dev@incubator.apache.org > Subject: Re: Duplicate Query - where none exists > > I think I saw this once. The problem is in JPA named queries are all > contained > in a single global namespace, so if you have to persistent beans that > define > queries with the same name you get a warning. It would be nice if the > warning > told you where the duplicate declarations are located. > > -dain > > On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: > > > Anyone seen this before > > > > WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" > > in "class > > .". Ignoring. > > > > This class has only three such named queries all different names and > > different actual queries. See following @NamedQueries( { > > @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s > WHERE > > s.id = :primaryKey"), > > @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM > > Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR > > UPPER(s.displayName) = :storeName2"), > > @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s > > > WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = > > :storeName2") > > }) > > > > I even renamed the duplicate parms to make sure it was not a trickle > > down exception. Not only that, if I comment out the StoreFXPK query I > > get the same error on the next named Query. I did a search on the > > workspace an this is only used in one place (factory class) and define > > in another (persistent class). I have no doubt this is something I > > have done but am unsure what it is I get the follow stack trace when > > executing the following line: > > > > Query q = em.createNamedQuery("StoreFXName"); <- not the same query > > mentioned in the above warning...the plot thickens > > > > The unmapped field in the stack trace is mapped. > > > > <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: > > Errors > > encountered while resolving metadata. See nested exceptions for > > details. > > at > > org.apache.openjpa.meta.MetaDataRepository.resolve > > (MetaDataRepository.java:501) > > at > > org.apache.openjpa.meta.MetaDataRepository.getMetaData > > (MetaDataRepository.java:2 > > 83) > > at > > org.apache.openjpa.meta.MetaDataRepository.getMetaData > > (MetaDataRepository.java:3 > > 38) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData( > > JPQLExpres > > sionBuilder.java:151) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaD > > ata(JPQLEx > > pressionBuilder.java:131) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD > > ata(JPQLEx > > pressionBuilder.java:211) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD > > ata(JPQLEx > > pressionBuilder.java:181) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType( > > JPQLExpres > > sionBuilder.java:174) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500 > > (JPQLExpressionBu > > ilder.java:61) > > at > > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder > > $ParsedJPQL.populate(JPQLExp > > ressionBuilder.java:1657) > > at > > org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52) > > at > > org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation > > (Expressio > > nStoreQuery.java:145) >
RE: Duplicate Query - where none exists
I think you may be on to something and have been looking into it. It is mapped and I thought worked but I am learning that I have a pretty messed up config (I had both Toplink and OpenJPA, I am accessing fields directly not through getters and am not positive that the mapping is right as it is one to many). I have other versions of the same mapping and this fairly commonly used class for my application as it represents categories that are grouped by categoryTpye. It does have a relation into the offended query class though - Here is the pertinent parts of the Store class: @ManyToOne @JoinColumn(name = "typeFK", referencedColumnName = "id") public Category getType() throws StoreTypeNotFoundException { return type; } - Here is the pertinent parts of the Category class: @Entity @Table(name = "category", schema = "bidspec") @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) @NamedQueries( { @NamedQuery(name = "CategoryFXType", query = "SELECT c FROM Category c WHERE c.type = :type"), @NamedQuery(name = "CategoryValueObjectFXPK", query = "SELECT c FROM Category c WHERE c.id = :primaryKey"), @NamedQuery(name = "CategoryFXDescription", query = "SELECT c FROM Category c WHERE UPPER(c.description) LIKE :description ORDER BY c.description") }) public class Category extends Persistable { ... @ManyToOne @JoinColumn(name = "categoryTypeFK", referencedColumnName = "id") public CategoryType getType() { return this.type; } Persistable is my base JPA persistable class housing the String id for all persistable classes -Original Message- From: Marc Prud'hommeaux [mailto:[EMAIL PROTECTED] On Behalf Of Marc Prud'hommeaux Sent: April 4, 2007 11:13 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists Phill- While I'm not sure the cause of the duplicate query error, I do notice the original cause in the nested stack trace is: > Caused by: <4|true|0.0.0> > org.apache.openjpa.persistence.ArgumentException: You cannot join on > column "category.categoryTypeFK". It is not managed by a mapping that > supports joins. It could be that this error is indirectly causing the next one. Have you looked into this? How is categoryTypeFK mapped? On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: > I did a workspace search and it exists in only one place. Also if I > comment out the one it complains about it complains about the next > one. But only in this java file. I even did an clean and build to make > sure there were no old class files hanging out. > > -----Original Message- > From: Dain Sundstrom [mailto:[EMAIL PROTECTED] > Sent: April 4, 2007 5:06 PM > To: open-jpa-dev@incubator.apache.org > Subject: Re: Duplicate Query - where none exists > > I think I saw this once. The problem is in JPA named queries are all > contained in a single global namespace, so if you have to persistent > beans that define queries with the same name you get a warning. It > would be nice if the warning told you where the duplicate declarations > are located. > > -dain > > On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: > >> Anyone seen this before >> >> WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" >> in "class >> .". Ignoring. >> >> This class has only three such named queries all different names and >> different actual queries. See following @NamedQueries( { >> @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s > WHERE >> s.id = :primaryKey"), >> @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM >> Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR >> UPPER(s.displayName) = :storeName2"), >> @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s > >> WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = >> :storeName2") >> }) >> >> I even renamed the duplicate parms to make sure it was not a trickle >> down exception. Not only that, if I comment out the StoreFXPK query I >> get the same error on the next named Query. I did a search on the >> workspace an this is only used in one place (factory class) and >> define in another (persistent class). I have no doubt this is >> something I have done but am unsure what it is I get the follow stack >> trace when executing the following line: >> >> Query q = em.createNamedQuery(&q
Re: Duplicate Query - where none exists
Phill- While I'm not sure the cause of the duplicate query error, I do notice the original cause in the nested stack trace is: Caused by: <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: You cannot join on column "category.categoryTypeFK". It is not managed by a mapping that supports joins. It could be that this error is indirectly causing the next one. Have you looked into this? How is categoryTypeFK mapped? On Apr 4, 2007, at 8:03 PM, Phill Moran wrote: I did a workspace search and it exists in only one place. Also if I comment out the one it complains about it complains about the next one. But only in this java file. I even did an clean and build to make sure there were no old class files hanging out. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 5:06 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarations are located. -dain On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: Anyone seen this before WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" in "class .". Ignoring. This class has only three such named queries all different names and different actual queries. See following @NamedQueries( { @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s WHERE s.id = :primaryKey"), @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR UPPER(s.displayName) = :storeName2"), @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = :storeName2") }) I even renamed the duplicate parms to make sure it was not a trickle down exception. Not only that, if I comment out the StoreFXPK query I get the same error on the next named Query. I did a search on the workspace an this is only used in one place (factory class) and define in another (persistent class). I have no doubt this is something I have done but am unsure what it is I get the follow stack trace when executing the following line: Query q = em.createNamedQuery("StoreFXName"); <- not the same query mentioned in the above warning...the plot thickens The unmapped field in the stack trace is mapped. <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: Errors encountered while resolving metadata. See nested exceptions for details. at org.apache.openjpa.meta.MetaDataRepository.resolve (MetaDataRepository.java:501) at org.apache.openjpa.meta.MetaDataRepository.getMetaData (MetaDataRepository.java:2 83) at org.apache.openjpa.meta.MetaDataRepository.getMetaData (MetaDataRepository.java:3 38) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData ( JPQLExpres sionBuilder.java:151) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMeta D ata(JPQLEx pressionBuilder.java:131) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMeta D ata(JPQLEx pressionBuilder.java:211) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMeta D ata(JPQLEx pressionBuilder.java:181) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType ( JPQLExpres sionBuilder.java:174) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500 (JPQLExpressionBu ilder.java:61) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder $ParsedJPQL.populate(JPQLExp ressionBuilder.java:1657) at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java: 52) at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilatio n (Expressio nStoreQuery.java:145) at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java: 642) at org.apache.openjpa.kernel.QueryImpl.compilationFromCache (QueryImpl.java:623) at org.apache.openjpa.kernel.QueryImpl.compileForCompilation (QueryImpl.java:589) at org.apache.openjpa.kernel.QueryImpl.compileForExecutor (QueryImpl.java:651) at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:558) at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery (EntityManagerI mpl.java:699) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorIm
RE: Duplicate Query - where none exists
I did a workspace search and it exists in only one place. Also if I comment out the one it complains about it complains about the next one. But only in this java file. I even did an clean and build to make sure there were no old class files hanging out. -Original Message- From: Dain Sundstrom [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 5:06 PM To: open-jpa-dev@incubator.apache.org Subject: Re: Duplicate Query - where none exists I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarations are located. -dain On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: > Anyone seen this before > > WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" > in "class > .". Ignoring. > > This class has only three such named queries all different names and > different actual queries. See following @NamedQueries( { > @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s WHERE > s.id = :primaryKey"), > @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM > Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR > UPPER(s.displayName) = :storeName2"), > @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s > WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = > :storeName2") > }) > > I even renamed the duplicate parms to make sure it was not a trickle > down exception. Not only that, if I comment out the StoreFXPK query I > get the same error on the next named Query. I did a search on the > workspace an this is only used in one place (factory class) and define > in another (persistent class). I have no doubt this is something I > have done but am unsure what it is I get the follow stack trace when > executing the following line: > > Query q = em.createNamedQuery("StoreFXName"); <- not the same query > mentioned in the above warning...the plot thickens > > The unmapped field in the stack trace is mapped. > > <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: > Errors > encountered while resolving metadata. See nested exceptions for > details. > at > org.apache.openjpa.meta.MetaDataRepository.resolve > (MetaDataRepository.java:501) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData > (MetaDataRepository.java:2 > 83) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData > (MetaDataRepository.java:3 > 38) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData( > JPQLExpres > sionBuilder.java:151) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaD > ata(JPQLEx > pressionBuilder.java:131) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD > ata(JPQLEx > pressionBuilder.java:211) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD > ata(JPQLEx > pressionBuilder.java:181) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType( > JPQLExpres > sionBuilder.java:174) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500 > (JPQLExpressionBu > ilder.java:61) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder > $ParsedJPQL.populate(JPQLExp > ressionBuilder.java:1657) > at > org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52) > at > org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation > (Expressio > nStoreQuery.java:145) > at > org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:642) > at > org.apache.openjpa.kernel.QueryImpl.compilationFromCache > (QueryImpl.java:623) > at > org.apache.openjpa.kernel.QueryImpl.compileForCompilation > (QueryImpl.java:589) > at > org.apache.openjpa.kernel.QueryImpl.compileForExecutor > (QueryImpl.java:651) > at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:558) > at > org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery > (EntityManagerI > mpl.java:699) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke > (NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke > (DelegatingMethodAccessorImpl.jav > a:25) > at java.lang.reflect.Method.invoke(Method.jav
Re: Duplicate Query - where none exists
I think I saw this once. The problem is in JPA named queries are all contained in a single global namespace, so if you have to persistent beans that define queries with the same name you get a warning. It would be nice if the warning told you where the duplicate declarations are located. -dain On Apr 3, 2007, at 10:07 PM, Phill Moran wrote: Anyone seen this before WARN [main] openjpa.MetaData - Found duplicate query "StoreFXPK" in "class .". Ignoring. This class has only three such named queries all different names and different actual queries. See following @NamedQueries( { @NamedQuery(name = "StoreFXPK", query = "SELECT s FROM Store s WHERE s.id = :primaryKey"), @NamedQuery(name = "StoreFXTypeAndName", query = "SELECT s FROM Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR UPPER(s.displayName) = :storeName2"), @NamedQuery(name = "StoreFXName", query = "SELECT s FROM Store s WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = :storeName2") }) I even renamed the duplicate parms to make sure it was not a trickle down exception. Not only that, if I comment out the StoreFXPK query I get the same error on the next named Query. I did a search on the workspace an this is only used in one place (factory class) and define in another (persistent class). I have no doubt this is something I have done but am unsure what it is I get the follow stack trace when executing the following line: Query q = em.createNamedQuery("StoreFXName"); <- not the same query mentioned in the above warning...the plot thickens The unmapped field in the stack trace is mapped. <4|true|0.0.0> org.apache.openjpa.persistence.ArgumentException: Errors encountered while resolving metadata. See nested exceptions for details. at org.apache.openjpa.meta.MetaDataRepository.resolve (MetaDataRepository.java:501) at org.apache.openjpa.meta.MetaDataRepository.getMetaData (MetaDataRepository.java:2 83) at org.apache.openjpa.meta.MetaDataRepository.getMetaData (MetaDataRepository.java:3 38) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassMetaData( JPQLExpres sionBuilder.java:151) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveClassMetaD ata(JPQLEx pressionBuilder.java:131) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD ata(JPQLEx pressionBuilder.java:211) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateMetaD ata(JPQLEx pressionBuilder.java:181) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandidateType( JPQLExpres sionBuilder.java:174) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$500 (JPQLExpressionBu ilder.java:61) at org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder $ParsedJPQL.populate(JPQLExp ressionBuilder.java:1657) at org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52) at org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCompilation (Expressio nStoreQuery.java:145) at org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:642) at org.apache.openjpa.kernel.QueryImpl.compilationFromCache (QueryImpl.java:623) at org.apache.openjpa.kernel.QueryImpl.compileForCompilation (QueryImpl.java:589) at org.apache.openjpa.kernel.QueryImpl.compileForExecutor (QueryImpl.java:651) at org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:558) at org.apache.openjpa.persistence.EntityManagerImpl.createNamedQuery (EntityManagerI mpl.java:699) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.jav a:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.orm.jpa.ExtendedEntityManagerCreator $ExtendedEntityManagerIn vocationHandler.invoke(ExtendedEntityManagerCreator.java:237) at $Proxy34.createNamedQuery(Unknown Source) at ca.BidSpec.emall.stores.StoreFactoryImpl.getStoreValueObjectByName (StoreFactoryI mpl.java:88) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.jav a:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio n(AopUtils .java:280) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoi npoint(Ref lectiveMethodInvocation.java:187) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed (R
RE: Duplicate Query - where none exists
I am using 0.9.6. I will see how to package this up so you can step through _ From: Hans J. Prueller [mailto:[EMAIL PROTECTED] Sent: April 4, 2007 10:28 AM To: open-jpa-dev@incubator.apache.org Subject: RE: Duplicate Query - where none exists I also encountered a similar problem with a 0.9.7 nightly snapshot: when creating an EMF, openJPA brings up the message "duplicate query PositionLog.findById" where definitiely only a single named query of that name exists. As everything else works, I didn't mind this message until now... hans Am Dienstag, den 03.04.2007, 22:23 -0700 schrieb Patrick Linskey: I haven't seen such a problem -- is it possible to package up the problem in something that we can step through in a debugger / take a closer look at? -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > -Original Message- > From: Phill Moran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 03, 2007 10:07 PM > To: open-jpa-dev@incubator.apache.org > Subject: Duplicate Query - where none exists > > Anyone seen this before > > WARN [main] openjpa.MetaData - Found duplicate query > "StoreFXPK" in "class > .". Ignoring. > > This class has only three such named queries all different > names and different > actual queries. See following > @NamedQueries( { > @NamedQuery(name = "StoreFXPK", query = "SELECT > s FROM Store s > WHERE s.id = :primaryKey"), > @NamedQuery(name = "StoreFXTypeAndName", query > = "SELECT s FROM > Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR > UPPER(s.displayName) = :storeName2"), > @NamedQuery(name = "StoreFXName", query = > "SELECT s FROM Store s > WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = > :storeName2") > }) > > I even renamed the duplicate parms to make sure it was not a > trickle down > exception. Not only that, if I comment out the StoreFXPK > query I get the same > error on the next named Query. I did a search on the > workspace an this is only > used in one place (factory class) and define in another > (persistent class). I > have no doubt this is something I have done but am unsure > what it is I get the > follow stack trace when executing the following line: > > Query q = em.createNamedQuery("StoreFXName"); <- not the same > query mentioned in > the above warning...the plot thickens > > The unmapped field in the stack trace is mapped. > > <4|true|0.0.0> > org.apache.openjpa.persistence.ArgumentException: Errors > encountered while resolving metadata. See nested exceptions > for details. > at > org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRep > ository.java:501) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDat > aRepository.java:2 > 83) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDat > aRepository.java:3 > 38) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassM > etaData(JPQLExpres > sionBuilder.java:151) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveCl > assMetaData(JPQLEx > pressionBuilder.java:131) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateMetaData(JPQLEx > pressionBuilder.java:211) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateMetaData(JPQLEx > pressionBuilder.java:181) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateType(JPQLExpres > sionBuilder.java:174) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$50 > 0(JPQLExpressionBu > ilder.java:61) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQ > L.populate(JPQLExp > ressionBuilder.java:1657) > at > org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52) > at > org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCom > pilation(Expressio >
RE: Duplicate Query - where none exists
I haven't seen such a problem -- is it possible to package up the problem in something that we can step through in a debugger / take a closer look at? -Patrick -- Patrick Linskey BEA Systems, Inc. ___ Notice: This email message, together with any attachments, may contain information of BEA Systems, Inc., its subsidiaries and affiliated entities, that may be confidential, proprietary, copyrighted and/or legally privileged, and is intended solely for the use of the individual or entity named in this message. If you are not the intended recipient, and have received this message in error, please immediately return this by email and then delete it. > -Original Message- > From: Phill Moran [mailto:[EMAIL PROTECTED] > Sent: Tuesday, April 03, 2007 10:07 PM > To: open-jpa-dev@incubator.apache.org > Subject: Duplicate Query - where none exists > > Anyone seen this before > > WARN [main] openjpa.MetaData - Found duplicate query > "StoreFXPK" in "class > .". Ignoring. > > This class has only three such named queries all different > names and different > actual queries. See following > @NamedQueries( { > @NamedQuery(name = "StoreFXPK", query = "SELECT > s FROM Store s > WHERE s.id = :primaryKey"), > @NamedQuery(name = "StoreFXTypeAndName", query > = "SELECT s FROM > Store s WHERE s.type = :type AND UPPER(s.name) LIKE :storeName OR > UPPER(s.displayName) = :storeName2"), > @NamedQuery(name = "StoreFXName", query = > "SELECT s FROM Store s > WHERE UPPER(s.name) = :storeName OR UPPER(s.displayName) = > :storeName2") > }) > > I even renamed the duplicate parms to make sure it was not a > trickle down > exception. Not only that, if I comment out the StoreFXPK > query I get the same > error on the next named Query. I did a search on the > workspace an this is only > used in one place (factory class) and define in another > (persistent class). I > have no doubt this is something I have done but am unsure > what it is I get the > follow stack trace when executing the following line: > > Query q = em.createNamedQuery("StoreFXName"); <- not the same > query mentioned in > the above warning...the plot thickens > > The unmapped field in the stack trace is mapped. > > <4|true|0.0.0> > org.apache.openjpa.persistence.ArgumentException: Errors > encountered while resolving metadata. See nested exceptions > for details. > at > org.apache.openjpa.meta.MetaDataRepository.resolve(MetaDataRep > ository.java:501) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDat > aRepository.java:2 > 83) > at > org.apache.openjpa.meta.MetaDataRepository.getMetaData(MetaDat > aRepository.java:3 > 38) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getClassM > etaData(JPQLExpres > sionBuilder.java:151) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.resolveCl > assMetaData(JPQLEx > pressionBuilder.java:131) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateMetaData(JPQLEx > pressionBuilder.java:211) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateMetaData(JPQLEx > pressionBuilder.java:181) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.getCandid > ateType(JPQLExpres > sionBuilder.java:174) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder.access$50 > 0(JPQLExpressionBu > ilder.java:61) > at > org.apache.openjpa.kernel.jpql.JPQLExpressionBuilder$ParsedJPQ > L.populate(JPQLExp > ressionBuilder.java:1657) > at > org.apache.openjpa.kernel.jpql.JPQLParser.populate(JPQLParser.java:52) > at > org.apache.openjpa.kernel.ExpressionStoreQuery.populateFromCom > pilation(Expressio > nStoreQuery.java:145) > at > org.apache.openjpa.kernel.QueryImpl.newCompilation(QueryImpl.java:642) > at > org.apache.openjpa.kernel.QueryImpl.compilationFromCache(Query > Impl.java:623) > at > org.apache.openjpa.kernel.QueryImpl.compileForCompilation(Quer > yImpl.java:589) > at > org.apache.openjpa.kernel.QueryImpl.compileForExecutor(QueryIm > pl.java:651) > at > org.apache.openjpa.kernel.QueryImpl.compile(QueryImpl.java:558) > at > org.apache.openjpa.persistence.EntityManagerImpl.createNamedQu > ery(EntityManagerI > mpl.java:699) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccess > orImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMeth > odAccessorImpl.jav > a:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.springframework.orm.jpa.ExtendedEntityManagerCreator$Exten > dedEntityManagerIn > vocationHandler.invoke(ExtendedEntityManagerCreator.java:237) > at $Proxy34.createNamedQuery(Unknown Source) > at > ca.BidSpec.