Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-2736

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

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.2.4.sp1
    • Fix Version/s: 4.3.0.Beta4
    • Component/s: query-criteria, query-hql
    • Labels:
      None
    • Last commented by a user?:
      true

      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

        Attachments

          Issue Links

            Activity

            Hide
            vincent.delhommois DELHOMMOIS added a comment -

            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

            Show
            vincent.delhommois DELHOMMOIS added a comment - 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=48 Julien 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
            Hide
            brmeyer Brett Meyer added a comment -

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

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

            Show
            brmeyer Brett Meyer added a comment - https://github.com/hibernate/hibernate-orm/pull/554 Incorporates pieces of the patches attached to HHH-6123 (modified) and adds a test case. I'd appreciate reviews before I push it.
            Hide
            wattsc3 Chris Watts added a comment -

            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.

            Show
            wattsc3 Chris Watts added a comment - 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.
            Hide
            brmeyer Brett Meyer added a comment -

            Bulk closing tickets resolved in released versions

            Show
            brmeyer Brett Meyer added a comment - Bulk closing tickets resolved in released versions
            Hide
            mspiegel Markus added a comment -

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

            Show
            mspiegel Markus added a comment - I understand this only works for SELECT, how about INSERT/UPDATE/DELETE ?

              People

              • Votes:
                45 Vote for this issue
                Watchers:
                37 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: