简体   繁体   中英

how to write this grails searchable query

In a grails project, some of the domain classes have a "region" field (not all of them). The logged in user is belonged to one the regions. I want to search those objects that 1- Does not have a region field OR 2- Their region field is equal to current user's region

How to handle this?

I solved it by an alternative method. I used a property with special unique value on region and added it to search query.

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