I got the error: "field [snip] should not be public nor internal"
AFAICT, it looks like only class properties are mappable, not fields. Please select from one of the possible explanations below:
a) We haven't gotten around to it. Send us a patch if you do
b) Shame on you for having public fields
c) a & b
d) none of the above
NHibernate version:
2.0.0 CR1
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="GCheckout.AutoGen.NewOrderNotification, GCheckout" table="orders">
<id name="googleordernumber" column="googleordernumber" type="String" length="256">
<generator class="assigned" />
</id>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Code:
ISession session = factory.OpenSession();
ITransaction transaction = session.BeginTransaction();
// Tell NHibernate that this object should be saved
session.Save(newOrder);
// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();
Full stack trace of any exception that occurs:
A first chance exception of type 'NHibernate.InvalidProxyTypeException' occurred in NHibernate.DLL
A first chance exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll
A first chance exception of type 'NUnit.Core.NUnitException' occurred in nunit.core.dll
############################################################################
############## F A I L U R E S #################
1) VendantUtil.tests.NotificationProcessorTest.BasicTest :
NHibernate.InvalidProxyTypeException : The following types may not be used as proxies:
GCheckout.AutoGen.NewOrderNotification: field buyermarketingpreferences should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field buyerbillingaddress should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field timestamp should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field googleordernumber should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field buyerid should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field buyershippingaddress should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field shoppingcart should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field ordertotal should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field fulfillmentorderstate should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field serialnumber should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field orderadjustment should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field promotions should not be public nor internal
GCheckout.AutoGen.NewOrderNotification: field financialorderstate should not be public nor internal
at
c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Cfg\Configuration.cs(802)
at
c:\CSharp\NH2.0.0\nhibernate\src\NHibernate\Cfg\Configuration.cs(981)
at
Name and version of the database you are using:
MySQL 5.0.16
The generated SQL (show_sql=true):
N/A