Is something like that going to work ????
Two classes mapped on two tables only - no join tables . OneToOne - bidirectional and ManyToOne unidirectional relationship Seminar can have multiple students<Users> ,seminar has one owner, user can be an owner of multiple seminars, user can take part in multiple seminars Is the mapping going to work @Entity public class Seminar {
@Id @GeneratedValue private long id; @OneToOne private User seminarOwner; @OneToMany(mappedBy="seminar") private List<Two> seminarStudents;
private int counting; }
@Entity public class Two {
@Id @GeneratedValue private long id; @OneToOne(mappedBy="two") private Seminar seminar; }
|