简体   繁体   中英

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?

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

to get Question from Tag

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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