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

String literals in an HQL query can get mangled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects versions: 4.1.9, 5.0.7
    • Fix versions: 5.1.0, 5.0.8
    • Components: query-hql
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      When calling Session.createQuery() with the query string
      "FROM Phase phase WHERE phase.comment= 'This is a test, Phase 1'"
      it is turned into
      "FROM com.example.Phase phase WHERE phase.comment= 'This is a test, com.example.Phase 1'"
      as shown by log output in the QueryTranslatorImpl. This is, to put it mildly, highly surprising and undesirable behaviour.

      The trigger seems to be the sequence <Comma Space Entity-Name>, which triggers a transformation of the entity name into the fully qualified class name even in string literals, where that has no business happening whatsoever.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: