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
|