Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

HQL Query

 
Nisejava Duram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have 2 classes Person and Address in a one-many relatioship
One person can have many addresses

I want to write the hql equivalent for this sql query
select * from Person p ,Address a where p.id=a.id and a.add_id='103'

// this is the query that is working for me now
from Person p inner join p.addresses where p.id='1'

But now I want to be able to select based on the address primary key
thanks

nise
 
Nisejava Duram
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks ... I solved it ... it was just a minor glitch
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!