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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T15:18:06+00:00 2026-05-10T15:18:06+00:00

Now, before you say it: I did Google and my hbm.xml file is an

  • 0

Now, before you say it: I did Google and my hbm.xml file is an Embedded Resource.

Here is the code I am calling:

ISession session = GetCurrentSession(); var returnObject =  session.Get<T>(Id); 

Here is my mapping file for the class:

<?xml version='1.0' encoding='utf-8' ?> <hibernate-mapping xmlns='urn:nhibernate-mapping-2.2'>   <class name='HQData.Objects.SubCategory, HQData' table='SubCategory' lazy='true'>     <id name='ID' column='ID' unsaved-value='0'>       <generator class='identity' />     </id>      <property name='Name' column='Name' />     <property name='NumberOfBuckets' column='NumberOfBuckets'  />     <property name='SearchCriteriaOne' column='SearchCriteriaOne' />      <bag name='_Businesses' cascade='all'>       <key column='SubCategoryId'/>       <one-to-many           class='HQData.Objects.Business, HQData'/>     </bag>      <bag name='_Buckets' cascade='all'>       <key column='SubCategoryId'/>       <one-to-many          class='HQData.Objects.Bucket, HQData'/>     </bag>    </class> </hibernate-mapping> 

Has anyone run to this issue before?

Here is the full error message:

MappingException: No persister for:  HQData.Objects.SubCategory]NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName, Boolean throwIfNotFound)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:766 NHibernate.Impl.SessionFactoryImpl.GetEntityPersister(String entityName)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionFactoryImpl.cs:752 NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Event\Default\DefaultLoadEventListener.cs:37 NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:2054 NHibernate.Impl.SessionImpl.Get(String entityName, Object id)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:1029 NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:1020 NHibernate.Impl.SessionImpl.Get(Object id)  in c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Impl\SessionImpl.cs:985 HQData.DataAccessUtils.NHibernateObjectHelper.LoadDataObject(Int32 Id)  in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQData\DataAccessUtils\NHibernateObjectHelper.cs:42 HQWebsite.LocalSearch.get_subCategory()  in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQWebsite\LocalSearch.aspx.cs:17 HQWebsite.LocalSearch.Page_Load(Object sender, EventArgs e)  in C:\Development\HQChannelRepo\HQ Channel Application\HQChannel\HQWebsite\LocalSearch.aspx.cs:27 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33 System.Web.UI.Control.OnLoad(EventArgs e) +99 System.Web.UI.Control.LoadRecursive() +47 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Update, here’s what the solution for my scenario was: I had changed some code and I wasn’t adding the Assembly to the config file during runtime.

  • 1 1 Answer
  • 2 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. 2026-05-10T15:18:06+00:00Added an answer on May 10, 2026 at 3:18 pm

    Sounds like you forgot to add a mapping assembly to the session factory configuration..

    If you’re using app.config…

    . .     <property name='show_sql'>true</property>     <property name='query.substitutions'>true 1, false 0, yes 'Y', no 'N'</property>     <mapping assembly='Project.DomainModel'/>  <!-- Here --> </session-factory> . . 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've never used Java AWT before and now I've got a piece of code
I'm a hobbyist programmer (only in TI-Basic before now), and after much, much, much
Third try at fixing this tonight - trying a different approach than before now.
I didn't use NGen before but now I need to improve startup performance of
I've used Codeigniter 1.7 before and now I've upgraded to Codeigniter 2. I'm trying
I haven't done much multithreading before and now find the need to do some
Now I have something that I have not seen it before: the database is
I'm now writing a registration screen before my tabBar shows up. My idea is
I was using Mysql database before and decided to switch to Postgresql and now,
I'm using JPA with with Google App Engine. Let's say I have a very

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.