Grails
  1. Grails
  2. GRAILS-8915

Grails 2.0.1 only fetching first element from eager collection

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.5, 2.1-RC3
    • Component/s: Persistence
    • Labels:
    • Environment:
      MacOSX Lion
    • Testcase included:
      yes

      Description

      The attached application contains an n:m relation between Authors and Books.
      Authors are fetched eagerly when loading a book.
      Bootstrap connects one book ("Book1") with two Authors ("Author1" and "Author2").
      In the integration test "BookTests" the expression

      Book.findByTitle('Book1').authors

      returns only "Author1" but not "Author2".
      The reason seems to be that the finderBy leads to a SQL statement that contains the join between books and author as needed for eager fetching but also a "limit"-expression.
      This seems to restrict the results that are fetched.

        Activity

        Oliver Wahlen created issue -
        Graeme Rocher made changes -
        Field Original Value New Value
        Fix Version/s 2.0.5 [ 13129 ]
        Fix Version/s 2.1 [ 13125 ]
        Priority Major [ 3 ] Blocker [ 1 ]
        Graeme Rocher made changes -
        Assignee Graeme Rocher [ graemerocher ]
        Graeme Rocher made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Graeme Rocher made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Oliver Wahlen
          • Votes:
            12 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development