1、一對一單向外鍵關聯
A、Annotation:@One2One @JoinColumn指定列名,默認為 字段_id
B、XML:<many-to-one unique="true"></many-to-one>
2、一對一雙向外鍵關聯
A、Annotation:@One2One(mappedBy=""),規律:凡是雙向關聯,必須設置mappedBy
B、XML:<many-to-one unique="true"></many-to-one>
<one-to-one property-ref=""></one-to-one>