Nhibernate Two-column matching on join


Check

<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>

currently my connection is in Id and my request looks like

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

I need something like this

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

Anyone can help me

+3
source share

Source: https://habr.com/ru/post/1774162/


All Articles