JPA @ManyToOne no mappedBy attribute exist

java, jpa, jpa-2.0, orm

Solution

Because the spec mandates that in a bidirectional OneToMany/ManyToOne association, the Many side must be the owner side (and thus doesn't need a `mappedBy` attribute), and the One side must be the inverse side (and thus needs a `mappedBy` attribute).

Problem

Why doesn't the `@ManyToOne` JPA specification have a `mappedBy` attribute? `@ManyToOne` has both unidirectional and bidirectional relationships, but `@OneToMany` has only unidirectional relationships. Why is that?

Original source