Tapestry
  1. Tapestry
  2. TAPESTRY-2658

HibernateGridDataSource.getAvailableRows should also call applyAdditionalConstraints() to prevent java.lang.IndexOutOfBoundsException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.0.15
    • Fix Version/s: 5.0.15
    • Component/s: tapestry-hibernate
    • Labels:
      None

      Description

      When applying a constraint to HibernateGridDataSource which reduces the number of rows an java.lang.IndexOutOfBoundsException is thrown because getAvailableRows() does not take into account the number of rows with the additional criteria applied.

      for example:
      Lets say we have a table named foo with 10 entries in it and we extend the datagrid like so:

      // for simplicity this would only return only 1 record in the table
      protected void applyAdditionalConstraints(Criteria criteria)
      {
      criteria.add( Property.forName("id").equals(new Integer(1) );
      }

      so we end up with getAvilableRows() returning a value of 10 and the results of prepare() retrieving only 1 row.

        Activity

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Joe Klecko
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development