This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to use inner join with hql query

 
Fabio Cunha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to construct a hqlquery using hibernate.

I need join two tables, city and state, and one single table to use him to show in a data table in my JSF application, can anybody helpme construct a criteria or hqlquery to join my table

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HQL and SQL are very similar. What have you got so far?
 
Fabio Cunha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already create a criteria to list my class



and i use this to show him in my xhtml file



it works, but now i want to mix two tables(using inner join or something) to show in my datatable
 
Arun Kumarr
Ranch Hand
Posts: 662
Eclipse IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create a SQL or HQL query as you always do and try converting mapping the resultset values into your custom class.
Check Transformers.aliasToBean method. See if it helps.
 
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!