Problem with duplicates using Grails' withCriteria function with a many-to-many relationship

后端 未结 1 343
攒了一身酷
攒了一身酷 2021-01-13 23:38

I\'ve got 2 tables, Question and Answer, with a many-to-many relationship (i.e. Questions can have multiple Answers and Answers can be reused by multiple Questions). For nor

相关标签:
1条回答
  • 2021-01-14 00:09

    Try adding this to your query to tell the Criteria to return only distinct Answer objects:

    resultTransformer org.hibernate.Criteria.DISTINCT_ROOT_ENTITY
    
    0 讨论(0)
提交回复
热议问题