简体   繁体   English

Grails:多对多关系的偏移量和最大值

[英]Grails: Offset and Max on many-to-many relationship

I following two domain classes with many to many relationship 我遵循两个具有多对多关系的领域类

Question{
    has many 'Tag'
}

Tag{
    has many 'Question'
}

now, I want to retrieve only 3 questions each time using max and offset property, how do I do that from controller? 现在,我只想使用max和offset属性每次仅检索3个问题,如何从控制器中做到这一点?

Question.list(max: YourMaxValue, offset: YourOffsetValue)

to get Question from Tag 从标签获取问题

Tag tag ..
tag.Question.list(max: YourMaxValue, offset: YourOffsetValue)

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

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