-->
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.  [ 4 posts ] 
Author Message
 Post subject: Unknown entity class
PostPosted: Tue Nov 15, 2005 11:46 am 
Hi forum users,

At execution I have this error:
Code:
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: NHibernate.MappingException: Unknown entity class: HSS.Com.VisitorManagement.BusinessObjects.User


Could it be because the SQL table isn't correctly mapped?

The Table:
Code:
CREATE TABLE [dbo].[TBL_User] (
   [UserId] [int] IDENTITY (1, 1) NOT NULL ,
   [lastModified] [timestamp] NULL ,
   [userName] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [firstName] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [lastName] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [password] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [email] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [status] [varchar] (50) COLLATE Latin1_General_CI_AS NULL ,
   [createDate] [datetime] NULL ,
   [createdByUserId] [int] NULL
) ON [PRIMARY]


The XML mapping:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
   <class name="HSS.Com.VisitorManagement.BusinessObjects.User,HSS.Com.VisitorManagement.BusinessObjects" table="TBL_User">

      <id name="UserId" column="UserId" type="System.Guid" unsaved-value="00000000-0000-0000-0000-000000000000">
         <generator class="guid" />
      </id>
      <property column="lastModified" type="byte[]" name="LastModified" />
      <property column="userName" type="String" name="UserName" length="50" />
      <property column="firstName" type="String" name="FirstName" length="50" />
      <property column="lastName" type="String" name="LastName" length="50" />
      <property column="password" type="String" name="Password" length="50" />
      <property column="email" type="String" name="Email" length="50" />
      <property column="status" type="String" name="Status" length="50" />
      <property column="createDate" type="DateTime" name="CreateDate" />
      <property column="createdByUserId" type="Int32" name="CreatedByUserId" />
      
   </class>
</hibernate-mapping>


Thank a lot for your ideas and help.

Reguards,
Pierre


Top
  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 12:12 pm 
Newbie

Joined: Fri Nov 04, 2005 2:45 pm
Posts: 18
Location: Gainesville, FL
Is the "Build Action" property of your mapping file set to "Embedded Resource"? That error usually means that NHib can't find the mapping file for your object.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 4:45 am 
Thx a lot iioshius :)

I feel a bit ashamed for not noticing that :oops:


Top
  
 
 Post subject:
PostPosted: Wed Nov 16, 2005 10:54 am 
Newbie

Joined: Fri Nov 04, 2005 2:45 pm
Posts: 18
Location: Gainesville, FL
No worries, I'm fairly sure we've all forgotten to do that a few (or a bunch, in my case) times.


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