This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Convert to hibernate simple SQL statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Convert to hibernate simple SQL statement" Watch "Convert to hibernate simple SQL statement" New topic
Author

Convert to hibernate simple SQL statement

Alex Krasnikov
Greenhorn

Joined: Apr 06, 2011
Posts: 1
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

Joined: Sep 01, 2010
Posts: 43

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)
 
GeeCON Prague 2014
 
subject: Convert to hibernate simple SQL statement