support for native/SQL query hints in HQL/Criteria (Oracle SELECT hints for example)

Description

Hello Everybody

In 2004 Gavin said: "I think we plan to add a Query.setQueryHint() method" (hibernate forum: http://forum.hibernate.org/viewtopic.php?p=2193761&sid=5cf2ec711851f726c700eb9f56c2866a ). But I still cannot find it in Hibernate Core/Hib. Annotation/Hib. EntityManager.

Can this enhancement request be opened / reopened?

It would be great for us to have such possibility.

Kind Regards,
Adam Wozniak

Environment

None

Activity

Show:
DELHOMMOIS
April 24, 2013, 3:11 PM

Hello,
We developed it

Vincent DELHOMMOIS
Manager S.I. Logistique Automobile
Tel : +33 (0)4 75 00 47 00
Mob: + 33 (0)6 35 48 07 19
P Pensez à l’environnement avant d’imprimer / Before printing, think about the environment.

De : Julien RENAUT (JIRA) jira@hibernate.atlassian.net
Envoyé : mercredi 24 avril 2013 17:10
À : DELHOMMOIS, Vincent
Objet : [JIRA] (HHH-2736) support for native/SQL query hints in HQL/Criteria (Oracle SELECT hints for example)

https://www.jboss.org/dms/hibernate/images/jira/jiraheader_hibernate.png

https://secure.gravatar.com/avatar/3d6d56f538d8ff97bf1f7c0f0a2a2db8?d=mm&s=48Julien RENAUT<https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=jrenaut> commented on [New Feature] HHH-2736<https://hibernate.atlassian.net/browse/HHH-2736>
support for native/SQL query hints in HQL/Criteria (Oracle SELECT hints for example)<https://hibernate.atlassian.net/browse/HHH-2736>

Bump.

This feature is needed.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Brett Meyer
July 10, 2013, 5:42 AM

https://github.com/hibernate/hibernate-orm/pull/554

Incorporates pieces of the patches attached to (modified) and adds a test case. I'd appreciate reviews before I push it.

Chris Watts
December 10, 2013, 12:25 PM

Is there plan to utilize http://docs.oracle.com/javaee/6/api/javax/persistence/QueryHint.html to allow Dialect specific hints?

i.e my wish list is:
@NamedQuery(name = "QueueMessage.bySystem", query = "select m from QueueMessage m where system = :system", hints=@QueryHint(name="SqlServer.ReadPast", value="true"))
Would end up giving:
Select field1, system from queue_message WITH (READPAST)

Or even some way to extend the dialect to provide this functionality as needed.

Brett Meyer
March 7, 2014, 10:08 PM

Bulk closing tickets resolved in released versions

Markus
October 13, 2015, 3:45 PM

I understand this only works for SELECT, how about INSERT/UPDATE/DELETE ?

Assignee

Brett Meyer

Reporter

Adam Wozniak

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure