• 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: 661
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic