-->
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.  [ 2 posts ] 
Author Message
 Post subject: Generating sql
PostPosted: Wed Aug 08, 2007 4:56 am 
Newbie

Joined: Tue Oct 25, 2005 6:04 am
Posts: 10
I need to create views from hql queries, or use them as inline views for larger sql queries. Hibernate doesn't support this, but a dirty hack comes to my mind. Hibernate somehow generates its sql, prepares the statements, sets parameters and sends the query to the database. If I could trick hibernate into giving me the generated sql and the paramters map, I could manipulate the sql (prepend "CREATE VIEW" etc), set the parameters from the map, and do the rest of the work directly.

This method could be equally useful with HQL and criteria queries because it would take over after SQL is generated.

Any ideas how I could do this?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 5:11 am 
Expert
Expert

Joined: Tue Dec 07, 2004 6:57 am
Posts: 285
Location: Nürnberg, Germany
you can log the sql. but i guess that you want to get the sql query at runtime?

_________________
Please don't forget to rate


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