Nhibernate映射在连接的两列上

时间:2010-11-10 19:33:36

标签: nhibernate nhibernate-mapping


检查

<class name="Blankhol" table="hoL" lazy="false">

    <id name="Id" column="H_Id" />

    <property name="MId" column="M_ID" insert="false" update="false" />


    <many-to-one name="MemInfo"
                 class="BusinessDataEntities.Domain.Net.Company, BusinessDataEntities"
                 lazy="false">
      <column name="M_ID" />
    </many-to-one>

    <join table="[Network]">
      <key column="H_Id" />
      <property name="NId" column="N_Id" insert="false" update="false"/>
    </join>

    <join table="[H_Outer]" optional="true">
      <key column="H_Id" />
    <property name="APS" column="AMPS_Prs" insert="false" update="false" />
      <property name="NId" column="N_Id" insert="false" update="false"/>
    </join>


  </class>

目前我的加入是ID,我的查询看起来像

Select * from h where h.id= N_Id.id

我想要一些像这样的东西

Select * from h
where h.id= N_Id.id and h.N_Id= ol.N_Id

任何人都可以帮助我

0 个答案:

没有答案