-->
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.  [ 5 posts ] 
Author Message
 Post subject: Problem with Quick Start Guide
PostPosted: Sat Mar 04, 2006 3:36 pm 
Newbie

Joined: Sat Mar 04, 2006 3:28 pm
Posts: 3
Hi All

I'm new with .net and also to NHibernate. I wanted to test the Quick Start Quide Example and I run into following problem. I can run the program but it stops on following line
cfg.AddAssembly("Omega");

with a MappingException (Could not add assembly named:Omega)

My User class is declared like this:

namespace Omega
{
public class User
{


So I do not know where the problem can come from.

can you please help?

Thank you

Herbert


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 04, 2006 7:22 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
The name of the .dll (or .exe) containing the mapping files is what matters, not the namespace. Check your project settings.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 8:09 am 
Newbie

Joined: Sat Mar 04, 2006 3:28 pm
Posts: 3
ok, i changed it into cfg.AddAssembly("WindowsApplication1");

and it goes now over. Now I have an error here

session.Save(newUser);

The error says: Unknown entity class: Omega.User

As you can see in the prior post, the namespace is Omega and the class is called User

my user.hbn.xml file looks like this

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="Omega.User, Omega" table="users">
<id name="Id" column="LogonId" type="String" length="20">
<generator class="assigned" />
</id>
<property name="UserName" column="Name" type="String" length="40"/>
<property name="Password" type="String" length="20"/>
<property name="EmailAddress" type="String" length="40"/>
<property name="LastLogon" type="DateTime"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 05, 2006 3:22 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
You have to change the assembly in the class names in the mapping files too. "Omega.User, Omega" -> "Omega.User, WindowsApplication1". Or change the assembly name in the project settings instead and use AddAssembly("Omega") as you did before.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 2:47 am 
Newbie

Joined: Sat Mar 04, 2006 3:28 pm
Posts: 3
OK i did. I changed the assembly name to Omega but I have still the same error.

Is there this example somewhere to download?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.