简体   繁体   中英

Grails where query criteria qualification

Is there a way to qualify method parameters versus domain properties in a Grails where query criteria when they are named identically?

For example:

def getPeople(age, sex) {
    People.find { age == age && sex == sex }
}

Something like this!?

def getPeople(age, sex) {
    People.find { delegate.age == age && delegate.sex == sex }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM