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 6939063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:34:26+00:00 2026-05-27T12:34:26+00:00

I have two mapping files for an order and a customer object. Customer Mapping:

  • 0

I have two mapping files for an order and a customer object.

Customer Mapping:

  <class name="OODB.Domain.Customer, OODB.Domain" entity-name="Customers">
     <id name="ID" column="customer_id">
      <generator class="guid" />
     </id>
     <property name="FirstName" column="first_name"/>
     <property name="LastName" column="last_name"/>
     <property name="EMail" column="email"/>
     <property name="Telephone" column="telephone" />

    <component name="Address" class="Address">
       <property name="Street" column="street"></property>
       <property name="PostalCode" column="postal_code"></property>
       <property name="City" column="city"></property>
    </component>
  </class>
 </hibernate-mapping>

Order Mapping:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="OODB.Domain"   namespace="OODB.Domain">  
  <class name="OODB.Domain.CustomerOrder, OODB.Domain" entity-name="Orders">
    <id name="ID" column="order_id">
      <generator class="guid"></generator>
    </id>
    <property name="OrderNo" column="order_no" length="8" not-null="true"></property>
    <property name="Status" column="status" not-null="true"></property>
    <many-to-one name="Orderer" class="Customer" column="customer_id" insert="true" not-found="exception" fetch="join"/>
  </class>
</hibernate-mapping>

Customer class:

namespace OODB.Domain
{
    public class Customer : ModelBase<Customer>
    {
        public virtual string FirstName
        {
            get;
            set;
        }

        public virtual string LastName
        {
            get;
            set;
        }

        public virtual string EMail
        {
            get;
            set;
        }

        public virtual string Telephone
        {
            get;
            set;
        }

        public virtual Address Address
        {
            get;
            set;
        }

...
}

Customer Order class:

public class CustomerOrder : ModelBase<CustomerOrder>
{
    public virtual string OrderNo
    {
        get;
        set;
    }

    public virtual Customer Orderer
    {
        get;
        set;
    }

    public virtual OrderStatus Status
    {
        get;
        set;
    }
...
}

Everything works great, if I remove the many-to-one stuff (Mappings are integrated as an embedded resource. I’ve checked this twice.). Otherwise I get the error ‘An association from the table Orders refers to an unmapped class: OODB.Domain.Customer’. But the Customer object is mapped… What I am missing?

  • 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-27T12:34:27+00:00Added an answer on May 27, 2026 at 12:34 pm

    I mixed up the table and entity-name attribute on the class element. :\

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two basic domain classes: public class Event { private Long id; private
I have a fluent mapping of a domain class that defines the names for
I have two tables that are related via a mapping table: keywords titles I
I would like to have a mapping which maps two string into one string.
I have a Voucher - POJO mapped to two tables. The first mapping assigns
Have two folders with approx. 150 java property files. In a shell script, how
I have two classes, and want to include a static instance of one class
I have two classes: public class Parent { public virtual long? ID { get;
I'm developing a simple webapp based on Spring framework. I have these two files
I have two classes: public class Article { private ISet<IdentNumber> identNumbers = new HashedSet<IdentNumber>();

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.