inverse=true in JPA annotations

Andy Dufresne picture Andy Dufresne · Feb 1, 2011 · Viewed 36.8k times · Source

In my application I use JPA 2.0 with Hibernate as the persistence provider. I have a one-to-many relationship between two entities (using a @JoinColumn and not @JoinTable). I wanted to know how could I specify inverse=true (as specified in hbm.xml) in JPA annotations to reverse the relationship owner.

Thank you.

Answer

Andy Dufresne picture Andy Dufresne · Feb 2, 2011

I found an answer to this. The mappedBy attribute of @OneToMany annotation behaves the same as inverse = true in the xml file.