Armenian Knowledge Base  

Go Back   Armenian Knowledge Base > Technical sections > Languages, Compilers, Interpreters
Register

Reply
 
LinkBack Thread Tools
Old 04.03.2007, 08:49   #1
Дошкольник
 
Join Date: 10 2004
Location: Yerevan
Age: 29
Posts: 116
Downloads: 8
Uploads: 0
Reputation: 2 | 0
Default NHibernate: Problem with Configuration

Hi guys, i'm getting confused with configuration errors of Hibernate for .NET:

I'm trying to map a simple MySQL table, which is completely independent from other tables. I looked through docs, forums, but didn't get any useful information/response.

I'm using .NET 2.0, MySQL 5.0, and NHibernatie 1.0.4
in my hibernate.cfg.xml sesson-factory scope i have:
Code:
<session-factory>
     <property name="dialect">NHibernate.Dialect.MySQLDialect</property>
     <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
     <property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
     <property name="connection.connection_string">Server=myHost;Database=realty;User ID=myUser;Password=myPass</property>

     <mapping assembly="Application.DB" />
   </session-factory>
here how i map a simple pesistent class:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
   namespace="Application.DB" assembly="Application.DB">

 <class name="SimpleTable" table="simpletable">

   <!-- A 32 hex character is our surrogate key. It's automatically
           generated by NHibernate with the UUID pattern. -->
   <id name="Id">
     <column name="id" sql-type="int" not-null="true"/>
     <generator class="uuid.hex" />
   </id>

   <property name="Text">
     <column name="text" />
   </property>
 </class>

</hibernate-mapping>
my persistent class (Application.SimpleTable) has valid structure for this configuration.

Also i referenced MySQL driver to my project.

When IIS is trying to Configure an instance, it throws an exception
Here's the Exception Message:
Could not load file or assembly 'Appartment.DB' or one of its dependencies. The system cannot find the file specified.

Actually i think that the problem is in <mapping> tag's attribute(s), what should i put there?
Reply With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 06:55.


Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.