Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 684561
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:49:49+00:00 2026-05-14T01:49:49+00:00

I am trying to implement a one-to-many relationship using NHibernate 2.1.2 but keep getting

  • 0

I am trying to implement a one-to-many relationship using NHibernate 2.1.2 but keep getting “Association references unmapped class” exceptions. I have verified that my hbm.xml files are embedded resource. Here are my classes and mappings. Any ideas?

public class OrderStatus
{
    public virtual decimal MainCommit { get; set; }
    public virtual decimal CommitNumber { get; set; }
    public virtual string InvoiceNumber { get; set; }
    public virtual string ShipTo { get; set; }
    public virtual string CustomerOrderNumber { get; set; }
    public virtual string Station { get; set; }
    public virtual DateTime RequestedShipDate { get; set; }
    public virtual decimal EstimatedValue { get; set; }
    public virtual decimal EstimatedWeight { get; set; }
    public virtual string Customer { get; set; }
    public virtual DateTime InvoiceDate { get; set; }
    public virtual ICollection<Promise> Promises { get; set; }
}

<class name="AladdinDb.Models.OrderStatus, AladdinDb" table="vorder_status">
    <id name="CommitNumber" type="decimal" column="commit_no">
        <generator class="assigned">
            <param name="property">
                Plan
            </param>
        </generator>
    </id>
    <property name="MainCommit" column="main_commit" type="decimal" />
    <property name="InvoiceNumber" column="invoice_no" type="string" />
    <property name="ShipTo" column="ship_to" type ="string"/>
    <property name="CustomerOrderNumber" column="cust_order_no" type="string" />
    <property name="Station" column="station" type="string" />
    <property name="RequestedShipDate" column="req_ship_date" type="DateTime" />
    <property name="EstimatedValue" column="estimated_value" type="decimal"/>
    <property name="EstimatedWeight" column="estimated_weight" type="decimal" />
    <property name="Customer" column="customer" type="string" />
    <property name="InvoiceDate" column="invoice_date" />
    <set name="Promises">
        <key column="commit_no"></key>
        <one-to-many class="Promise" />
    </set>
</class>

public class Promise
{
    public virtual decimal CommitNumber { get; set; }
    public virtual DateTime PromiseDate { get; set; }
    public virtual string WhoAsked { get; set; }
    public virtual string WhoGave { get; set; }
    public virtual string Iffy { get; set; }
}

<class name="AladdinDb.Models.Promise, AladdinDb" table="promise">
    <id name="CommitNumber" type="decimal" column="commit_no">
        <generator class="assigned" />
    </id>
    <property name="PromiseDate" column="promise_date" />
    <property name="WhoAsked" column="who_asked" />
    <property name="WhoGave" column="who_gave" />
    <property name="Iffy" column="iffy" />
</class>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:49:49+00:00Added an answer on May 14, 2026 at 1:49 am

    You need to use the fully qualified classname in the association, just as in your class mappings.

    Use the assembly and namespace attributes on the hibernate-mapping element if you want to use unqualified class names.

    <set name="Promises">
        <key column="commit_no" />
        <one-to-many class="AladdinDb.Models.Promise, AladdinDb" />
    </set>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement Type Hinting of PHP5 on one of my class,
I'm trying to implement the repository pattern using a generic repository like the one
I'm trying to understand how to best implement a polymorphic one-to-many in hibernate. Eg:
I am trying to implement OpenID as one preferred option to my next web
I am trying to implement google map api into one of my web page
I am trying to implement Mutex lock on one of my static function of
I'm trying to implement a segue from one a table view controller to another
I'm trying to implement a tab menu just like the one in Stack Overflow.
i am trying to implement discrete curve evolution algorithm in c++ do any one
I'm trying to implement a system with two clients one of them sends a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.