I have the following case, I am trying to do a many to many mapping like a User and all the teams in which the user belongs to.
Class AID
private int b
private int c
@IdClass(AID.class)
Class A
@Id
@SequenceGenerator(name = "b_seq", sequenceName = "id_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "b_seq")
private int b
@Id
@Column(name = "col_c")
private int c
Class D
#need to define a many to many mapping with A here
Assuming class D is the Teams class and class A has a composite key as primary key how would I proceed?