Java Mailing List Archive

http://www.gg3721.com/

Home » users.openjpa »

Query Mayhem

C N Davies

2010-02-26

Replies: Find Java Web Hosting

Author LoginPost Reply
Hi,



I am using Open JPA 2.0 Beta and I have some JPQL that seems to be confusing
the parser. Here is my query:



SELECT ct.assets.queue.uniqueid from Contract ct where ct.uniqueid =
'0000012444686ECC'



Here is my parse error:





"Error message: No field named "queue" in class "class
com.trm.core.Contract".





If you look at my query there is no reference to "queue" in the Contract
class, the dotted notation shows I am looking for the queue in the Contract
entity's "Assets" vector



Here is the Contract entity snippet:



public class Contract extends MasterObject {



..snip..



       /** The assets. */

       @OneToMany(cascade={CascadeType.ALL})

       private List<Asset> assets;



..snip..



}







Here is the Asset entity:



public class Asset extends CoreObject {

       

..snip..



/** The queue. */

       @ManyToOne(cascade={CascadeType.REFRESH})

       private Queue queue;

..snip..

         

}





So I believe my JPQL is correct and that OpenJPA is confused. Or maybe I am
J



Thanks for any pointers!



Chris



©2008 gg3721.com - Jax Systems, LLC, U.S.A.