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

Cannot put more than 1000 elements in a InExpression

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1 rc2, 3.2.0.alpha1
    • Fix Version/s: 4.1.7, 4.3.0.Beta1
    • Component/s: hibernate-core
    • Labels:
      None
    • Environment:
      Oracle 9i
    • Last commented by a user?:
      true
    • Sprint:

      Description

      The number of elements that we can put in a "in" expression is limited to a certain amount (1000 for Oracle, for instance). When creating a criteria query, the org.hibernate.criterion.InExpression class should split the expression into several smaller ones.

      Attached is a patch which splits the expression by slices of 500 elements. For example, if we have 1001 elements to put in the "in" expression, the result would be :
      (entity.field in (?, ?, ?...) or entity.field in (?, ?, ?...) or entity.field in )

      The surrounding parantheses are useful to avoid problems with other conditions (a "and" condition taking over the one of the "or" conditions).

        Attachments

        1. Animal.hbm.xml
          0.4 kB
        2. hibernate-inexpression-oracle-3.2.patch
          2 kB
        3. HQLHelper.java
          15 kB
        4. LongInElementsTest.java
          2 kB
        5. patch.txt
          2 kB

          Issue links

            Activity

              People

              • Votes:
                44 Vote for this issue
                Watchers:
                47 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 1h Original Estimate - 1h
                  1h
                  Remaining:
                  Time Spent - 53m Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - 53m Remaining Estimate - 1h
                  53m