如何在NHibernate中获得它? [英] How to get it in NHibernate?

查看:81
本文介绍了如何在NHibernate中获得它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果我有:
表1(CustomerID,CompanyName,ContactName)
Table2(CustomerID,CustomerName)

在NHibernate中:如何获取List< table1>包括:
CustomerID,CustomerName,CompanyName,ContactName?

For an example, if i have:
Table1(CustomerID, CompanyName, ContactName)
Table2(CustomerID, CustomerName)

in NHibernate: How do i get List<table1> include:
CustomerID, CustomerName, CompanyName, ContactName ?

推荐答案

看看这篇文章:NHibernate变得简单 [ ^ ]
这应该对您有帮助.
Have a look at this article:NHibernate Made Simple[^]
This should help you out.


在休眠映射文件中添加以下内容:

in the hibernate mapping file add following:

<join table="Orders">
      <key column="CustomerID"/>
      <property name="CompanyName" update="false" insert="false"/>
    </join>


这篇关于如何在NHibernate中获得它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆