Note that there are some explanatory texts on larger screens.

plurals
  1. PONewbie problem with NHibernate version 2.1.2.4000 Mapping
    primarykey
    data
    text
    <p>I have what appears to be a simple mapping problem in NHibernate, however I have been struggling to find a solution to the problem for a number of days now, and would appreciate some assistance. I am using VB.NET under VS2005. My VS2005 solution structure is as follows:</p> <p>Solution: PsalertsIP<br> Project (Assembly): Core </p> <p>Folder Data (Namespace PsalertsIp.Core.Data)<br> Contains Interfaces for communication with repository classes example: PsalertsEventRepo Implements IPsalertsEventRepo </p> <p>Folder Domain (Namespace PsalertsIP.Core.Domain) Contains all POCO domain objects and related interfaces example: PsalertsEvent Implements IPsalertsEvent</p> <p>Also underneath the assembly 'Core' are the NHibernate config file and the mapping file for the PsalertsEvent class, which is as follows:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="Core" namespace="Core.Domain"&gt; &lt;class name="PsalertsEvent" table="Source_table" lazy="true"&gt; &lt;id name="Id" column="Id" type="long" unsaved-value="0" access="field.camelcase-underscore"&gt; &lt;generator class="native" &gt; &lt;param name="sequence"&gt;My_Oracle_Sequence&lt;/param&gt; &lt;/generator&gt; &lt;/id&gt; &lt;property name="Substation" column="Field1" /&gt; &lt;property name="BusbarId" column="Field2" /&gt; &lt;property name="PlantId" column="Field3" /&gt; &lt;property name="AlarmName" column="Field4" /&gt; &lt;property name="AlarmStatus" column="Field5" /&gt; &lt;property name="EventTime" column="Field6" /&gt; &lt;/class&gt; &lt;/hibernate-mapping&gt; </code></pre> <p>When I attempt to carry out a simple test of the NHibernate environment through NUnit (appreciate that this isn't unit testing, however needed a simple vehicle to test the NHibernate setup), the test fails, and I observe the following output in NUnit: </p> <p>PsalertsIp.Tests.Data.PSALERTSEventRepoTests (TestFixtureSetUp):<br> System.TypeInitializationException : The type initializer for 'Nested' threw an exception.<br> ----> NHibernate.MappingException : Could not compile the mapping document: PsalertsEvent.hbm.xml<br> ----> NHibernate.MappingException : persistent class Core.Domain.PsalertsEvent, Core not found<br> ----> System.TypeLoadException : Could not load type 'Core.Domain.PsalertsEvent' from assembly 'Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.</p> <p>I suspect that the problem may be to do with the structure of the solution in VS2005, however I have tested multiple different assembly/namespace permutations to no avail.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload