Grails
  1. Grails
  2. GRAILS-8707

@Mock domain classes don't support sort/order params on findBy queries

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.0 final
    • Fix Version/s: 2.0.4
    • Component/s: Persistence, Testing
    • Labels:
      None

      Description

      A query like Person.findAllByX('foo', [sort: 'x']) will sort results correctly but when using findBy to return a single result the result will be the first matching object that was inserted. I guess the sort is being applied after the query returns the results.

      Test app attached.

        Activity

        Hide
        Marcin Erdmann added a comment -

        Fix available in a pull request for grails-data-mapping: https://github.com/SpringSource/grails-data-mapping/pull/44

        Show
        Marcin Erdmann added a comment - Fix available in a pull request for grails-data-mapping: https://github.com/SpringSource/grails-data-mapping/pull/44

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Fletcher
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development