Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-RC2
    • Component/s: None
    • Labels:
      None

      Description

      using the latest git version

      This works :

      def mainCategory = Category.findAllByName("main").get(0)
      def q = User.where { category == mainCategory }.sort("username", "desc")
      def users = q.list()
      

      This causes an error :

      def mainCategory = Category.findAllByName("main").get(0)
      def q = User.where { username != 'test' && category == mainCategory }.sort("username", "desc")
      def users = q.list()
      

      Error is :

      Class groovy.lang.MissingPropertyException
      Message No such property: mainCategory for class: grails.gorm.DetachedCriteria
      

      I have created a demo project on github that reproduces this error

      https://github.com/cameronbraid/grails-where-query-parameterised

      Look at the DemoController, the index method works, but index2 fails as above

        Activity

        Show
        Graeme Rocher added a comment - Fixed by https://github.com/SpringSource/grails-data-mapping/commit/f277911ba8cc9a2ebfbc0f5bc6602e76a2c07572
        Hide
        Cameron Braid added a comment -

        Thanks for the quick turnaround.

        I see the commit in that git repo - though I am not sure how I am to build using it.

        I have grails-core cloned here and am building that, however I can't see any plugins for grails-data-mapping, how is that integrated into grails ?

        Cheers

        Cameron

        Show
        Cameron Braid added a comment - Thanks for the quick turnaround. I see the commit in that git repo - though I am not sure how I am to build using it. I have grails-core cloned here and am building that, however I can't see any plugins for grails-data-mapping, how is that integrated into grails ? Cheers Cameron

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Cameron Braid
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development