-->
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.  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Tue Jul 08, 2008 9:28 am 
Beginner
Beginner

Joined: Wed Apr 23, 2008 2:00 pm
Posts: 20
thanks credmond, finally i've done it with the native sql :)
and thanks all of you too for the informations !


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 08, 2008 10:47 am 
Newbie

Joined: Fri May 09, 2008 2:18 pm
Posts: 8
Good to hear! ;)


Top
 Profile  
 
 Post subject: Re: Embedding Oracle query hints in HQL?
PostPosted: Wed Feb 03, 2010 1:06 am 
Newbie

Joined: Wed Feb 03, 2010 12:46 am
Posts: 1
Native query is probably best.

But, I did get a HQL query hint to work using a combination of query.setComment() and an EmptyInterceptor subclass with overridden onPrepareStatement() method. If the comment matches a pre-defined query hint string, insert that hint into the SQL after the select. In my case (Informix 11) it needed a new line after the hint, before the rest of the statement, to avoid a syntax error.

Like:

Code:
select
--+ORDERED
col1, col2, etc.
..


Note the hint syntax also - this (dashdashplus) thing seems to work for Informix and Sybase. I think maybe Oracle too, but I can't back that up.

Also, for some reason the comment is a part of the SQL string passed to onPrepareStatement(). Sometimes, not always??

So a bit of a hack but it apparently can be done.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 18 posts ]  Go to page Previous  1, 2

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.