-->
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.  [ 1 post ] 
Author Message
 Post subject: NHibernate in multi tier app help please
PostPosted: Tue Jun 29, 2010 5:03 pm 
Newbie

Joined: Tue Jun 01, 2010 3:37 pm
Posts: 3
Hi all, I am having trouble using NHibernate in a multi tier application. I am trying to have the following:
- Data Access Layer
- Class Library
- Business Logic
- Presentation Layer

What I am thinking and what I have done already is the following:
- I have the Persistent Manager class in my Data Access Layer and I am trying to put my mapping files in here too.
- Class Library only has my class definitions. For example, public class Customer
- Business Logic will have classes that extend the classes found in my Class Library (avoids circular referencing).
- Presentation Layer simply displays data.

I am getting the following error, No persister for ClassLibrary.Customer.

I tried moving the Customer.hbm.xml file to my ClassLibrary project but still no luck.

My Customer.hbm.xml file:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="ClassLibrary"
assembly="ClassLibrary">
<class name="ClassLibrary.Customer, ClassLibrary" table="Customer" lazy="false">
<id name="CustomerID">
<column name="CustomerID" />
<generator class="identity" />
</id>
<property name="DateModified" />
<property name="CustomerName" />
</class>
</hibernate-mapping>


My class file (this is in a project called ClassLibrary):
namespace ClassLibrary
{
public class Customer
{
public DateTime DateModified { get; set; }
public String CustomerName { get; set; }
public int CustomerID { get; set; }
}
}


I would appreciate any help on the matter as I am going round in circles at the moment. It all works when I place it in the single project but ideally I want to place it in seperate projects (multi tier application).

Thanks everyone.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.