This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one 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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Convert to hibernate simple SQL statement