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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:33:06+00:00 2026-05-29T05:33:06+00:00

I have to use an HQL query in my project and I’ve an error

  • 0

I have to use an HQL query in my project and I’ve an error : “entity is not mapped”.

When I read nHibernate HQL – entity is not mapped or nHibernate HQL – entity is not mapped (or other web site) I can read that I have to use auto-import=”true” on each class.

<hibernate-mapping
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 namespace="BusinessObjets" assembly="BusinessObjects"
 xmlns="urn:nhibernate-mapping-2.2" auto-import="true"> ...

How can we set up this auto imports when we use mapping by code with nhibernate 3.2 ?

I use that code to load the mapping :

var mapper = new ModelMapper();
mapper.AddMappings(typeof(Repository).Assembly.GetTypes());
return mapper.CompileMappingForAllExplicitlyAddedEntities();

Regards

  • 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-29T05:33:07+00:00Added an answer on May 29, 2026 at 5:33 am

    You can’t set it in mapping-by-code directly, but you can modify HbmMapping object returned from CompileMappingForAllExplicitlyAddedEntities method, before you pass it to the Configuration object:

    mapping.autoimport = true;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use NHibernate 1 and have a HQL query SELECT mo FROM MyObject mo
I use the fallowing HQL-Query with NHibernate: from Contact a where a.Id in (select
I have a named hql query which makes use of object constructors for an
I have a problem with a Criteria query. In an other method I use
I have use include ('base.php') script in my other scripts ( more.php ). Now
I have to use several SOAP messages to get data from a web service.
I'm working on a .NET C# project on which I had to use NHibernate
So I have a HQL Query like so: String query = from records where
I have a problem with NHibernate not using my mappings configuration for eager loading
I have this hql query, which works perfect: select m from Media m join

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.