-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: HQL to native SQL
PostPosted: Wed Mar 05, 2008 5:42 am 
Newbie

Joined: Wed Mar 05, 2008 4:50 am
Posts: 3
Hi,
I have an uncommon (I guess) problem.
After I create a Query object with HQL statement, is there a way to get corresponding native SQL query string from it?

It happens that I have a bunch of display filters, which generate HQL queries, and a resultSet-based report generation tool, which accepts only native SQL queries. It would be good to have some direct translation to easy associate a report with a filter, without a need to change the report tool.

Thanks in advance!
Jakub


Top
 Profile  
 
 Post subject: re: HQL to native SQL
PostPosted: Wed Mar 05, 2008 2:50 pm 
Newbie

Joined: Tue Apr 25, 2006 1:17 pm
Posts: 19
set show_sql to true (and format_sql as well to help with readablity)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 06, 2008 6:28 am 
Newbie

Joined: Wed Mar 05, 2008 4:50 am
Posts: 3
Thanks, but I don't need to actually see the resulting SQL string, I need to get it _programatically_ from Query (or some other place in Hibernate) to use in other class.
Jakub


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.