2
class Person {
    String name
    Country bornInCountry

    static embedded = ['bornInCountry']
}

class Country {
    String name
}

How can I filter Person by name?
When I use name in query (eg. Person.countByNameIsNotNull()), Person is filtered by bornInCountry.name instead.

Generated sql with loggingSql = true:

Hibernate: 
    select
        count(*) as y0_ 
    from
        person this_ 
    where
        this_.born_in_country_name is not null

Code is taken from grails documentation
grails version: 2.5.3

dev7532
  • 101
  • 1
  • 1
  • 4

0 Answers0