Thread:
 Various issues 
 Idiosyncrasy   17 Jun 2006, 10:29 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: Idiosyncrasy (17 Jun 2006, 10:29) Replies: 0, Views: 27036
Subject: Various issues
You may encounter a number of issues while working through the above 
quickstart; here are some tips:

(1) Don't forget to name your assembly; in Visual Studio 2005 go to 
the project menu and select <projectname> properties at the bottom of 
the menu. Here make sure the Assembly Name is equal to the one you're 
using in your .hbm.xml mapping files and specifying in your 
AddAssembly call.

(2) In both versions I tried (1.0.2.0 and 1.2.0.Alpha1) I got 
an "method get_Id() should be virtual" error. To allow dynamic proxy 
generation in your class you must add a virtual modifier to all you 
accessors, like this:

        public virtual string Id
        {
            get { return id; }
            set { id = value; }
        }

(3) If you get an "invalid column name" exception even when you're 
sure the column names are correctly spelled in the mapping file, try 
using a fully qualified name for the database table, for example:

        <class name="NHibernate.Examples.QuickStart.User, 
NHibernate.Examples" table="[NHibernate].[dbo].[Users]">
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]