JPA Bidirectional OneToMany and ManyToOne?
- by PhoenixJon
I'm using Oracle JDeveloper 11g Release 2.
I created two tables A and B using SQL developer.
Table A has a FK to table B. Using the Entities from Tables function, I created two JPA files from it.
A has @ManyToOne annotation on FK.
And also B has @OneToMany annotation to A. I don't want this.
Can I remove this @OneToMany annotation automatically?
public class A implements Serializable {
...
@ManyToOne
@JoinColumn(name = "FIELD_B")
private B b;
...
}
public class B implements Serializable {
...
@OneToMany(mappedBy = "B")
private List<A> assetList;
...
}
I don't need @OneToMany mapping.