HQL joins in Grails: Part Deux

前端 未结 2 1323
野的像风
野的像风 2021-01-25 10:39

This is an extension of the question I asked here

I have a relationship like this

class Foo {
    static hasMany = [bars: Bar]
}

class Bar {
    // Has          


        
2条回答
  •  旧巷少年郎
    2021-01-25 11:06

    Would something like this work ?

    Foo.withCriteria {
        bars {
            in('id', thing.bars.collect { it.id })
        }
    }
    

提交回复
热议问题