This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Convert to hibernate simple SQL statement

 
Alex Krasnikov
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone
Could you please help to convert tis sql statement to hibernate:
select * from table1 t1, table2 t2
where t1.id = t2.id;

thanks in advance
sorry for mistakes its my first topic here
 
Anantha Sharma
Ranch Hand
Posts: 43
Android Hibernate jQuery
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HQL: from Table1 t1, Table2 t2 where t1.id=t2.id

This can get much simpler if you could share the mapping files you used for these 2 tables..

remember, in HQL you cannot use the table name, you can only use the POJO name (which is mapped)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic