ManyToOne annotation to specific column
问题 I am trying to create the follow structure using Hibernate with annotations: To create a ManyToMany relationship I had created two classes called SessionRiu and SessionRiuId (pk). This way the Session class has two foreign keys (agend_id and user_id) but when I try to create the OneToMany from operation the hibernate does not create the foreign using the id from session: Session FKs: Operation FKs ( empty ): As I am beginner in java and hibernate, I would appreciate any suggest about my code.