Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-2658

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 5.0.15
    • 5.0.15
    • tapestry-hibernate
    • 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.

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            buckofive Joe Klecko
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: