views:

27

answers:

1

<property name="NetworkRunId" column="Network_Run_Id" />
<property name="StudyKey" column="Study_Key" insert="false" update="false" />
<property name="AnnualizationFactor" column="Annualization_Factor" />
<property name="CreateDate" column="Create_Date" />
<property name="ModifyDate" column="Modify_Date" />

<many-to-one name="StudyInfo" class="Study" lazy="false" cascade="save-update">
  <column name="Study_Key" />
</many-to-one>

<many-to-one name="MemberInfo"
             class="BusinessDataEntities.Domain.NetworkAdministration.VHAMemberCompany, BusinessDataEntities"
             lazy="false">
  <column name="Member_ID" />
</many-to-one>

<many-to-one name="NetworkRunStudyXrefInfo"
             class="BusinessDataEntities.Domain.NetworkAdministration.NetworkRunStudyXref, BusinessDataEntities"
             lazy="false">
  <column name="Network_Run_Id" />
</many-to-one>

<join table="[HCO_Spend_Network_Run_Study]">
  <key column="HCO_Spend_Id" />
  <property name="NetworkRunId" column="Network_Run_Id" insert="false" update="false"/>
</join>

issue with the

Network run id not exist in the first table but i have a join that is having the Network_Run_Id as property how do i fix this

A: 

If the column NetworkRunId is your primary key, then map it with the <id> element.

<class ...>
    <id name="NetworkRunId" column="Network_Run_Id">
        <generator class="identity"/>
    </id>
</class>

As for the generator class, choose whichever best fits with your underlying database engine.

EDIT #1

In order to map a many-to-many association, you might want to take an eye on the documentation about Collection Mapping. Perhaps scrolling down to 6.3 will answer your question.

Will Marcouiller
<many-to-one name="NetworkRunStudyXrefInfo" class="BusinessDataEntities.Domain.NetworkAdministration.NetworkRunStudyXref, BusinessDataEntities" lazy="false"> <column name="Network_Run_Id" /></many-to-one>in this code i am getting error saying the Network_Run_Id not exist in table yes it's not exist but in the join condition i have the Network_Run_Id as property how to do many-to-one with the other table and the column name Network_Run_Id matches
bharat
Please see my edit for a link to the NH documentation.
Will Marcouiller

related questions