I am founding some legacy code in my job where some of the following shows up:
For simplification, imagine a One class and a Many class.
In One Class I got:
@OneToMany(mappedBy = "toOne")
private List<Many> manies;
@JoinColumn(name = "unrelated", referencedColumnName = "id")
mappedBy" links the 2 sides of the relation nothing more. If you omit the
JoinColumn then it will use a join table to manage the relation. If you use
JoinColumn then it manages the relation via an FK in the "many side". Very simple. It will use how many
@Id fields there are in the "1 side" for the FK.