-->
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: Persist classes in seperate assembly to Xml Mapping
PostPosted: Fri Apr 03, 2009 10:33 am 
Newbie

Joined: Fri Apr 03, 2009 9:40 am
Posts: 10
I'm new to NHibernate, so be gentle :-)

We have an existing business layer containing C# entities.

I am about to write a data access layer, using NHibernate to bind the relational database (SQL 2005) to the business layer.

I can get this to work in a simple test app, but things go bad when I try to seperate the BL and DAL into seperate assemblies. In effect, the persist classes (the entities in my BL) live in one assembly and the XML mappings (in the form of an hbm.xml file) live in another.

When I attempt to retrieve data from the DB with code similar to

session.Load(typeof(ApplicationEntity), id);

the NHibernate runtime fails to find the persister because it lives in another assembly (the BL).

Has anyone got any advice? Is what I'm trying to do fundamentally wrong?

Cheers.

FlyTVR


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 03, 2009 3:21 pm 
Hi there.

Try put the name of your hbm file with full path to your assembly.
i.e. <your_assembly_name>.<your_hbm_file>.hbm.xml.

Sometimes Nhibernate cannot find a resource in another assembly without especifing full name.

[]s


Top
  
 
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.