Grails
  1. Grails
  2. GRAILS-8350

Add compile errors for properties of relations in Where queries

    Details

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

      Description

      Let's say you have a Book class with an author property of type Author. I would like the query

      Book.where { author.nam =~ "Stephen%" }
      

      to fail with a compilation error (the property should be name). The main reason for this request is that I think users will find it very strange that authr.name is a compilation error but the above is not.

      You can use the project attached to GRAILS-8344 for testing. Just edit the query in BookController.groovy.

        Activity

        Show
        Graeme Rocher added a comment - Fixed by https://github.com/SpringSource/grails-data-mapping/commit/9d6c3680167486a004305a7832668f2e04028711

          People

          • Assignee:
            Graeme Rocher
            Reporter:
            Peter Ledbrook
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development