Persist a List with order and duplicates in JPA/EclipseLink

前端 未结 1 929
逝去的感伤
逝去的感伤 2021-01-16 11:22

I have basically two Entities Entity1 and Entity2. Entity1 contains this bit of Code:

@OneToMany(cascade=CascadeType.         


        
相关标签:
1条回答
  • 2021-01-16 12:01

    EclipseLink does not currently support duplicates for OneToMany relationships. Duplicate are support for (basic) ElementCollection mappings.

    Please vote for bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=256978

    The best solution is to map the join table to another entity and define a 1-m to it with a 1-1 to the target.

    0 讨论(0)
提交回复
热议问题