-->
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.  [ 4 posts ] 
Author Message
 Post subject: Get SQL translated from HQL
PostPosted: Fri Jan 27, 2006 11:34 am 
Newbie

Joined: Mon Jan 23, 2006 10:04 am
Posts: 9
I was not able to find out some posibility to get SQL, that is translated from HQL.

I mean method like:

Query qu=session.createQuery(hql);
qu.setParams(....);

qu.translate();
sql=qu.getSQL();

Thanks,

Lukas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 12:45 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
you can enable the output of sql in the Hibernate configuration => read Hibernate reference or you can configure your logging to debug sql statements.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
 Post subject: I want that SQL in application
PostPosted: Fri Jan 27, 2006 12:58 pm 
Newbie

Joined: Mon Jan 23, 2006 10:04 am
Posts: 9
Hi,
I know and use this.
I wanted to save the generated SQL into database during session, without executing it.
I develop application that runs upon AS/400 DB2 (and many others). And there is batch processing of queries during night - the queries are very complex upon large bank data.

But by another client I want to execute it satement directly from fat client app. in HQL.

I don't like to write statement generation twice - to HQL and SQL, that's why I need this at application level.
I traced query exectuion and found it very diffucult to hack somewhere inside Hibernate to achieve this.... that's why I ask at forum.

Lukas


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 27, 2006 1:06 pm 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
I think that the queries are finally compiled by the jdbc driver.

So you might hack this.

Another idea. Have a lock at c-jdbc it is a replicating driver. Which replicates queries to a number of databases. When your AS400 is down ;-) the queries are saved. May be there is a way to retrieve them.

Regards Sebastian

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.