开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜