ORM对复合主键的支持 [英] ORM support for compound primary keys
本文介绍了ORM对复合主键的支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
I've read that compound primary keys will confuse the hell out of typical ORM code generators. Which ORMs work best with compound PKs and which to avoid? (I've a particular interest in .NET)
推荐答案
我已成功使用NHibernate和复合键.
I'm using NHibernate successfully with compound keys.
<class name="UserProfileField" table="UserProfileFields">
<composite-id>
<key-many-to-one name="Parent" column="UserId" lazy="false"/>
<key-property name="FieldName"/>
</composite-id>
...
这篇关于ORM对复合主键的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文