JPA / Hibernate OneToMany Mapping, using a composite PrimaryKey
I'm currently struggling with the right mapping annotations for a scenario using a composite Primary Key Class. First, what I am trying to achieve in words: I have 2 classes: group and FieldAccessRule. A Group can have many FieldAccessRules, while a FieldAccessRule only has ONE Group assigned. Modling this is not a problem so far (simplified): public class Group{ ... @OneToMany(mappedBy = "group") private Set<FieldAccessRule> fieldAccessRules; ... } and for the FieldAccessRule: public class FieldAccessRule { ... @ManyToOne @JoinColumn(name = "group_id") private Group group; ... } Now, I