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

IN parameter is not enclosed in parentheses

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

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

      Description

      We have a query with the following parts:

          LEFT JOIN (reservation_detail rd INNER JOIN reservation r ON (r.id = rd.reservation_id AND r.status NOT IN :cancelled ))
          ...
          WHERE hrt.hotel_id IN :hotelIds AND ...
      

      The second one that doesn't have any parentheses is generated properly

           WHERE hrt.hotel_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,...)
      

      But the first part becomes

          LEFT JOIN (reservation_detail rd INNER JOIN reservation r ON (r.id = rd.reservation_id AND r.status NOT IN ?, ?, ? ))
      

      Currently the workaround is to add the parentheses, so I'm submitting this as minor priority, but it's my understanding that the JPA implementation is supposed to add them.

      Note that this is in a Named Native Query. It might work in JPQL queries, but we don't use them, because it's much harder to develop and test them in pgAdmin

        Attachments

          Issue links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: