Hibernate CollectionOfElements EAGER fetch duplicates elements

后端 未结 6 1888
礼貌的吻别
礼貌的吻别 2020-12-04 11:28

I have a class called SynonymMapping which has a collection of values mapped as a CollectionOfElements

@Entity(name = \"synonymmapping\")
public class Synony         


        
6条回答
  •  时光取名叫无心
    2020-12-04 12:10

    I have faced this problem and I solved it using

    criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);

    This clears out the duplicates which are caused by the join made to the child tables.

提交回复
热议问题