I like the little template :).
I'm getting the following exception when testing some code with NUnit:
Method not found: Int32 System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode
If it matters, this is an ASP.NET project. I have used NHibernate successfully with a Windows Forms project recently. However I'm am NHibernate beginner, so please forgive any obvious mistakes :)
I hope this all explains my problem properly.
Thanks :)
Hibernate version: 1.2.1001
Mapping documents:
Quote:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated from NHibernate.Mapping.Attributes on 2006-07-04 11:59:34Z.-->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="QuickLawInvoice.Data.InvoiceEntry, QuickLawInvoice">
<id name="InvoiceEntryId" type="Int32">
<generator class="identity" />
</id>
<property name="LawDatabase" />
<property name="Date" />
<property name="Time" />
<property name="Duration" />
<property name="Charges" />
</class>
<class name="QuickLawInvoice.Data.InvoiceSection, QuickLawInvoice">
<id name="InvoiceSectionId" type="Int32">
<generator class="identity" />
</id>
<property name="ClientId" />
<property name="ReceivedLbi" />
<property name="CreatedInvoice" />
<property name="CostCenterId" />
<property name="GlId" />
<bag name="Entries" cascade="save-update">
<key column="InvoiceSectionId" />
<one-to-many class="QuickLawInvoice.Data.InvoiceEntry, QuickLawInvoice" />
</bag>
</class>
<class name="QuickLawInvoice.Data.InvoiceSpreadsheet, QuickLawInvoice">
<id name="InvoiceSpreadsheetId" type="Int32">
<generator class="identity" />
</id>
<property name="UploadDate" />
<property name="InvoiceDate" />
<property name="QuickLawInvoiceNumber" />
<bag name="Sections" cascade="save-update">
<key column="InvoiceSpreadsheetId" />
<one-to-many class="QuickLawInvoice.Data.SectionData, QuickLawInvoice" />
</bag>
</class>
<class name="QuickLawInvoice.Data.PersonData, QuickLawInvoice">
<id name="PersonDataId" type="Int32">
<generator class="identity" />
</id>
<property name="Name" />
<property name="Email" />
<bag name="Invoices" cascade="save-update">
<key column="PersonDataId" />
<one-to-many class="QuickLawInvoice.Data.InvoiceSection, QuickLawInvoice" />
</bag>
</class>
<class name="QuickLawInvoice.Data.SectionData, QuickLawInvoice">
<id name="SectionDataId" type="Int32">
<generator class="identity" />
</id>
<property name="Name" />
<property name="ApproverName" />
<property name="ApproverEmail" />
<bag name="People" cascade="save-update">
<key column="SectionDataId" />
<one-to-many class="QuickLawInvoice.Data.PersonData, QuickLawInvoice" />
</bag>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():Quote:
ITransaction transaction = session.BeginTransaction();
session.Save( s );
transaction.Commit();
Full stack trace of any exception that occurs:Quote:
TestCase 'TimeKeeper.Test.DatabaseTest.testSave'
failed: System.MissingMethodException : Method not found: Int32 System.Runtime.CompilerServices.RuntimeHelpers.GetHashCode(System.Object).
at NHibernate.IdentityHashCodeProvider.GetHashCode(Object obj)
at System.Collections.Hashtable.GetHash(Object key)
at System.Collections.Hashtable.get_Item(Object key)
c:\net\nhibernate\nhibernate\src\NHibernate\Util\SequencedHashMap.cs(276,0): at NHibernate.Util.SequencedHashMap.get_Item(Object o)
c:\net\nhibernate\nhibernate\src\NHibernate\Util\IdentityMap.cs(196,0): at NHibernate.Util.IdentityMap.get_Item(Object key)
c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs(662,0): at NHibernate.Impl.SessionImpl.GetEntry(Object obj)
c:\net\nhibernate\nhibernate\src\NHibernate\Impl\SessionImpl.cs(703,0): at NHibernate.Impl.SessionImpl.Save(Object obj)
u:\craig-work\quicklawinvoice\test\databasetest.cs(47,0): at TimeKeeper.Test.DatabaseTest.testSave()
Name and version of the database you are using:
MS SQL 2000
The generated SQL (show_sql=true): Mmm, not certain.
Debug level Hibernate log excerpt: Empty.