4 Replies Latest reply on May 10, 2006 10:57 AM by mazz

    How to write @ManyToMany/@JoinTable if join table has third

    Gus Gu Expert

      Hi All,

      I have a question on how to write @ManyToMany and @JoinTable code, e.g. a join table is

      table member_party (
      member_id,
      party_id,
      joined_date)

      how to modify the following codes:
      @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.EAGER)
       @JoinTable(table = @Table(name = "member_party"),
       joinColumns = {@JoinColumn(name = "MEMBER_ID")},
       inverseJoinColumns = {@JoinColumn(name = "PARTY_ID")})
      
      Many thanks for any help!