-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How can I query the object that has primary key class
PostPosted: Tue Sep 19, 2006 2:05 am 
Newbie

Joined: Tue Aug 29, 2006 2:54 am
Posts: 16
I have two class, Persion.java and PersonPK.java

http://www.hibernate.org/hib_docs/reference/en/html/queryhql.html
According to this document, I can query the object like
from Person where person.id.country = 'AU' and person.id.medicareNumber = 123456

But it occur exception,
org.hibernate.hql.ast.QuerySyntaxError: Invalid path: 'person.id.country'
Is there someting wroing with the query?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 19, 2006 2:32 am 
Beginner
Beginner

Joined: Mon Nov 22, 2004 11:21 am
Posts: 42
I think the alias "person" is missing in your query, so please try either:
Code:
from Person person where person.id.country = 'AU' and person.id.medicareNumber = 123456

or:
Code:
from Person where id.country = 'AU' and id.medicareNumber = 123456


Regards,
Georg

P.S.: Please rate this posting if it helps solving the problem.

_________________
Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.