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.