These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Association references unmapped class in Nhibernate
PostPosted: Tue Sep 07, 2010 3:25 am 
Newbie

Joined: Mon Sep 06, 2010 3:20 am
Posts: 7
Dear All ,

I am having the following error when using NHibernate:
Association references unmapped class.

The mapping file on which I am getting the error is as follows:

Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">

  <class name="TP.CoE.Services.EmployeeInformationSystemEntities.JobPositionSetup,TP.CoE.Services.EmployeeInformationSystemEntities" table="JOB_POSITION_SETUP" >

    <id name="Id" column="JOB_POSITION_ID" type="System.Decimal" unsaved-value="null">
      <generator class="sequence">
        <param name="sequence">SEQ_JOB_POS_SETUP_ID</param>
      </generator>
    </id>

    <property name="Createddate" column="CREATED_DATE" access="field.pascalcase-underscore" not-null="false" type="System.DateTime"  insert="true" update="true"/>
    <property name="Updateddate" column="UPDATED_DATE" access="field.pascalcase-underscore" not-null="false" type="System.DateTime"  insert="true" update="true"/>
    <property name="Salary" column="SALARY" access="field.pascalcase-underscore" not-null="false" type="System.Double"  insert="true" update="true"/>
    <property name="Name" column="NAME" access="field.pascalcase-underscore" not-null="false" type="System.String"  insert="true" update="true"/>


    <many-to-one name="Reportingposition"  access="field.pascalcase-underscore" not-null="false" outer-join="auto" insert="true" update="true">
      <column name="REPORTING_POSITION_ID"/>
    </many-to-one>
    <many-to-one name="Createdby"  access="field.pascalcase-underscore" not-null="false" outer-join="auto" insert="true" update="true">
      <column name="CREATED_BY"/>
    </many-to-one>
    <many-to-one name="Updatedby"  access="field.pascalcase-underscore" not-null="false" outer-join="auto" insert="true" update="true">
      <column name="UPDATED_BY"/>
    </many-to-one>
    <many-to-one name="Jobgroupdesignation"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
      <column name="JOB_GROUP_DESIGNATION_ID"/>
    </many-to-one>
    <many-to-one name="Orgstructurelastlevel"  access="field.pascalcase-underscore" not-null="false" outer-join="auto" insert="true" update="true">
      <column name="ORG_STRUCTURE_LAST_LEVEL_ID"/>
    </many-to-one>

    <many-to-one name="Office"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
      <column name="OFFICE_ID"/>
    </many-to-one>

    <many-to-one name="Status"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
      <column name="STATUS_ID"/>
    </many-to-one>

    <many-to-one name="Employmenttype"  access="field.pascalcase-underscore" not-null="true" outer-join="auto" insert="true" update="true">
      <column name="EMPLOYMENT_TYPE_ID"/>
    </many-to-one>

    <many-to-one name="Organization"  access="field.pascalcase-underscore"  not-null="true" outer-join="auto" insert="true" update="true">
      <column name="ORGANIZATION_ID"/>
    </many-to-one>


    <bag  name="FKJPREPORTINGPOSITIONID" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
      <key>
        <column name="REPORTING_POSITION_ID"/>
      </key>
      <one-to-many class="TP.CoE.Services.EmployeeInformationSystemEntities.JobPositionSetup,TP.CoE.Services.EmployeeInformationSystemEntities"/>
    </bag >
    <bag  name="FKPOSINFOJOBPOSITIONID" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
      <key>
        <column name="JOB_POSITION_ID"/>
      </key>
      <one-to-many class="TP.CoE.Services.EmployeeInformationSystemEntities.PositionInfo,TP.CoE.Services.EmployeeInformationSystemEntities"/>
    </bag >
    <bag  name="FKJHJOBPOSITIONID" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
      <key>
        <column name="JOB_POSITION_ID"/>
      </key>
      <one-to-many class="TP.CoE.Services.EmployeeInformationSystemEntities.JobPositionHistory,TP.CoE.Services.EmployeeInformationSystemEntities"/>
    </bag >
    <bag  name="FKJHREPORTINGPOSITIONID" cascade="none" inverse="true" lazy="true" access="field.pascalcase-underscore">
      <key>
        <column name="REPORTING_POSITION_ID"/>
      </key>
      <one-to-many class="TP.CoE.Services.EmployeeInformationSystemEntities.JobPositionHistory,TP.CoE.Services.EmployeeInformationSystemEntities" />
    </bag >
   
  </class>
</hibernate-mapping>


I have checked the table there are many Foreign keys in it and all are mentioned in the mappings file , plus the Build action is also set to Embeded Resource , still I am not able to guess why this error is occurring ,any help would be really appreciated.

Regards,
Fahad.


Top
 Profile  
 
 Post subject: Re: Association references unmapped class in Nhibernate
PostPosted: Tue Sep 07, 2010 11:12 am 
Newbie

Joined: Tue Apr 06, 2010 1:09 pm
Posts: 9
Maybe the problem isn't th map file. Could you please post the classes?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.