How to make a one-to-many bidirectional relation with JPA annotations, where the collection side owns it
问题 I have from the Hibernate docs a mapping in XML. My question is how to do it with JPA annotations. It is a one-to-many bidirectional relation, and the collection side owns it. Thanks. <class name="Person"> <id name="id" column="personId"> <generator class="native"/> </id> <set name="addresses" table="PersonAddress"> <key column="personId"/> <many-to-many column="addressId" unique="true" class="Address"/> </set> </class> <class name="Address"> <id name="id" column="addressId"> <generator class