简体   繁体   English

Grails包括可搜索查询构建器中的空值检查

[英]Grails including null value check in searchable query builder

We are using grails 2.1.1 and searchable - 0.6.3 我们使用的是grails 2.1.1和可搜索的 - 0.6.3

We are trying to filter results using query builder . 我们正在尝试使用query builder过滤结果。 Our problem is that we cannot put a check on tupples having null in a field. 我们的问题是我们无法检查字段中具有null的tupples。 We have gone through lots of documentation but couldn't find any solution. 我们已经完成了大量文档,但找不到任何解决方案。

Is there a way to put a null value check using query builder in grails searchable plugin . 有没有办法在grails searchable plugin使用查询生成器进行null value check

using 运用

mustNot(term('columnName',null))

or 要么

mustNot(term('columnName','null'))

does not work. 不起作用。

Try this: 尝试这个:

mustNot(gt("columnName", 0)) mustNot(gt(“columnName”,0))

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

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