-->
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.  [ 3 posts ] 
Author Message
 Post subject: "get_Id should be virtual" exception
PostPosted: Mon Jun 26, 2006 1:18 am 
Contributor
Contributor

Joined: Tue May 30, 2006 1:25 am
Posts: 29
Hibernate version: svn last revision 2140

Full stack trace of any exception that occurs:
at NHibernate.Proxy.ProxyTypeValidator.Error(Type type, String reason) in c:\CSharp\NHibernate20\src\NHibernate\Proxy\ProxyTypeValidator.cs:line 28
at NHibernate.Proxy.ProxyTypeValidator.CheckMethodIsVirtual(Type type, MethodInfo method) in c:\CSharp\NHibernate20\src\NHibernate\Proxy\ProxyTypeValidator.cs:line 76
at NHibernate.Proxy.ProxyTypeValidator.CheckEveryPublicMemberIsVirtual(Type type) in c:\CSharp\NHibernate20\src\NHibernate\Proxy\ProxyTypeValidator.cs:line 63
at NHibernate.Proxy.ProxyTypeValidator.ValidateType(Type type) in c:\CSharp\NHibernate20\src\NHibernate\Proxy\ProxyTypeValidator.cs:line 22
at NHibernate.Cfg.Configuration.ValidateProxyInterface(PersistentClass persistentClass) in c:\CSharp\NHibernate20\src\NHibernate\Cfg\Configuration.cs:line 887
at NHibernate.Cfg.Configuration.Validate() in c:\CSharp\NHibernate20\src\NHibernate\Cfg\Configuration.cs:line 863
at NHibernate.Cfg.Configuration.BuildSessionFactory() in c:\CSharp\NHibernate20\src\NHibernate\Cfg\Configuration.cs:line 1007
at HibernateHelpers.NHibernateHelper.InitializeSessionFactory() in C:\CSharp\CSLA_NHb\NHibernateHelpers\NHibernateHelper.cs:line 83
at HibernateHelpers.NHibernateHelper.GetSession() in C:\CSharp\CSLA_NHb\NHibernateHelpers\NHibernateHelper.cs:line 96
at HibernateHelpers.PersistanceManager.Save(Object obj) in C:\CSharp\CSLA_NHb\NHibernateHelpers\PersistanceHelper.cs:line 73
at NHbHelpers.Test.PersistanceHelpersTest.SaveTest() in C:\CSharp\CSLA_NHb\NHbHelpers.Test\PersistanceHelpersTest.cs:line 27


Name and version of the database you are using:Firebird
Mapping:
<class name="NHb.DomainModel.SimplyTypes, NHb.DomainModel" table="SimplyTypes">
<id column="ID" name="_id" type="Int64" access="field">
<generator class="sequence" >
<param name="sequence">P_OID</param>
</generator>
</id>
<property name="StrF" column="STRF" type="string" access="property"/>
<property name="Dt" column="DT" type="Date" access="property"/>
<property name="Doub" column="DOUB" type="Double" access="property"/>
</class>


I have made a simply test project with simply session.Save and session.Load method. With the version 1.0.2 (modified by me only for FirebirdDriver) it work fine.
Then i had change the reference to NHibenate to the new DLL compiled with the last svn version (revision 2140), i run the test and the test stop for:
NHbHelpers.Test.PersistanceHelpersTest.SaveTest : NHibernate.InvalidProxyTypeException : Type 'NHb.DomainModel.SimplyTypes' cannot be specified as proxy: method get_Id should be virtual

any idea?

Thanks.
Fabio.

_________________
Fabio Maulo.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 3:18 am 
Regular
Regular

Joined: Fri Feb 18, 2005 3:34 am
Posts: 88
Location: Poland/Wrocław
In the new NH the classes are ``lazy'' by default and it is being checked whether a property is virtual because it is required to build a proxy class for it.

Think you must mark the class manually as non-lazy and possibly turn off virtualilzation checking.

All this has been described in the http://forum.hibernate.org/viewtopic.php?t=960004 thread

_________________
Please rate this post if you've found it helpfull
Roland


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 26, 2006 9:01 am 
Contributor
Contributor

Joined: Tue May 30, 2006 1:25 am
Posts: 29
uuuuuuuuuuuh sorry is true!!
I'm so stupid.
I forget the "default-lazy" in the config.
Thanks man.

_________________
Fabio Maulo.


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