简体   繁体   English

如何编写此grails可搜索查询

[英]how to write this grails searchable query

In a grails project, some of the domain classes have a "region" field (not all of them). 在grails项目中,某些域类具有“区域”字段(并非全部)。 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 我想搜索那些1-没有区域字段或2-他们的区域字段等于当前用户区域的对象

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. 我在区域上使用了具有特殊唯一值的属性,并将其添加到搜索查询中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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