Grails GORM的行为不一致

时间:2018-12-14 14:02:28

标签: grails gorm grails-domain-class

在尝试运行查询时,我遇到了grails GORM的以下问题。

 List<Reply> sentReplies = ResponseOption.where {
        message {
            source {
                parentSource {
                    organization == org
                }
            }
        }
  }.list()

println(sentReplies.size()) // ===> 0

println(Replies.list().findAll { 
    it.message.source.parentSource.organization == org 
}.size()) // ===> 20

Replies.list().each {
    println("${it.message.source.parentSource.organization == org}")
} 
//
true
true
true
true
true
true
true
true
true
true

行为不一致且奇怪

注意::在运行单元测试时,我有这种奇怪的经历,与此同时,在我的应用程序正常执行期间执行该测试时,它可以按预期工作。我需要进行一些配置吗?

0 个答案:

没有答案