-->
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: N Hibernate creating DAL
PostPosted: Sun May 01, 2011 8:11 am 
Newbie

Joined: Sun May 01, 2011 8:00 am
Posts: 1
Hi

Im presently looking to build a fresh application using a standard 3 tier architecture, however im struggling to get the mapping files to work correctly.

I have create

PresentationLayer
BusinessLogicLayer (class lib)
DataAccessLayer (class lib)
DataObjects (class lib)

As seperate projects, Data Objects contains the table mappings and class definitions for the table objects, i want to use this openly across all the other tiers in the application, in my presentation layer i have my web config which contains under the hibernate config

<mapping assembly="DataObjects"/>

However as soon as i try and impliment a query i receive

Companies is not mapped [FROM Companies]

Under my Mappings folder within DataObjects namespace i have

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="DataObjects" assembly="DataObjects">
<class name="DataObjects.Companies, DataObjects" table="Companies" lazy="false">
<id name="DataObjects.CompanyID">
<column name="CompanyID"/>
<generator class="native"/>
</id>
<property name="CompanyName">
<column name="CompanyName"/>
</property>
<property name="CompanyCreatedDate">
<column name="CompanyCreatedDate"/>
</property>
<property name="CompanyActive">
<column name="CompanyActive"/>
</property>
</class>
</hibernate-mapping>

The hbm files are also set as embedded resource, so im just wondering if anyone has any ideas where i could be going wrong or any links to a good tutorial which follows a similar approach, as all the ones i have seen so far use a single lib to wrap the mapping / data access / business logic into.

Thanks appreciate any advice anyone can provide.

Mike


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.