-->
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: Unknown entity class: QuickStart.Cat
PostPosted: Wed Mar 25, 2009 4:55 am 
Newbie

Joined: Wed Mar 25, 2009 4:46 am
Posts: 1
Hi

I am new to NHibernate...

While trying to run the sample given by the documentation, I am getting the following Error..

Unknown entity class: QuickStart.Cat

If I am changing the .hbm file build action property to embedded resource I am getting different error in the line

sessionFactory = new NHibernate.Cfg.Configuration().Configure().BuildSessionFactory();

ERROR:

The type initializer for 'QuickStart.NHibernateHelper' threw an exception

Please help me to solve this problem.

Cat.hbm.xml File:

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="QuickStart" assembly="QuickStart">
<class name="Cat" table="Cat">
<!-- A 32 hex character is our surrogate key. It's automatically
generated by NHibernate with the UUID pattern. -->
<id name="Id">
<column name="CatId" sql-type="char(32)" not-null="true"/>
<generator class="uuid.hex" />
</id>
<!-- A cat has to have a name, but it shouldn' be too long. -->
<property name="Name">
<column name="Name" length="16" not-null="true" />
</property>
<property name="Sex" />
<property name="Weight" />
</class>
</hibernate-mapping>


Web Config:

<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
</configSections>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.connection_string">Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True</property>
<!--<mapping resource="Quickstart.Cat.hbm.xml" assembly="Quickstart" />-->
<mapping assembly="QuickStart"/>
</session-factory>
</hibernate-configuration>


Thanks in advance[/b]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 02, 2009 9:34 am 
Newbie

Joined: Thu Apr 02, 2009 9:30 am
Posts: 2
ignore my post. it wasn't actually the same problem at all.


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