One - to -one mapping using non primary key
I have two tables:
Table1 : { id:primary key name: email: }
Table2: Lid: primary key tname: email: }
In both the cases email is neither primary key, nor the foreign. Is it possible to establish one-to-开发者_Go百科one mapping between both of these tables for the column email. I am using xml for mapping.
<many-to-one class="Table2Entity" name="Table2Entity" property-ref="Email">
<column name="Email" />
</many-to-one>
however you get errors if you also map email as property an table1 because column email would be mapped twice
精彩评论