JPA ManyToMany, how can JoinTable have a property?

前端 未结 3 1655
夕颜
夕颜 2020-12-31 13:10

I have a question for designing the ManyToMany in EJB, how can a jointable has a property?
Here is an example, the students and courses are ManyToMany, every student hav

3条回答
  •  悲&欢浪女
    2020-12-31 13:33

    It is possible.

    You just need to replace many-to-many mapping with the explicit combination of one-to-many and many-to-one mappings via a 3rd entity, that would represent the association between the two primary entities (student and course in your example).

    Please read details here

提交回复
热议问题