Mapping ManyToMany with composite Primary key and Annotation:

I solved this issue. I mapped Getter instead of field.

public class StudentTClass {

    //@EmbeddedId
    private StudentTClassPK pk = new StudentTClassPK();

    @EmbeddedId
    public StudentTClassPK getPk() {
        return pk;
    }

Leave a Comment