-->
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.  [ 1 post ] 
Author Message
 Post subject: How to get the generated SQL from a JPA query BEFORE execute
PostPosted: Thu Apr 09, 2009 6:50 pm 
Newbie

Joined: Thu Apr 09, 2009 6:40 pm
Posts: 1
This is probably a common question but hours of googling provided no suitable solution,

- I need to use Oracle's flashback capability with the "AS OF" clause

- as far as I can tell JPA JPQL does not support this

- as far as I can tell hibernate criteria queries do not support this

We have JPA entity classes with lots of complex named queries specified and java methods that take input and bind params and execute and everything works fine

I don't want to have to Re-specify all of these queries in SQL so I can append the AS OF clause

I want to look up the JPA named query, determine what the generated SQL will be, then append the AS OF clause to that, and create a new native SQL query to execute

this way all our defined queries remain as is, and only on the rare occasion that we need a flashback query will we go through this process

but it seems ridiculously difficult to determine what SQL will be generated BEFORE it is sent to the DB, unless I am missing something really obvious...

thanks


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

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.