Note that there are some explanatory texts on larger screens.

plurals
  1. POMapping Error in NHibernate
    primarykey
    data
    text
    <p>I am trying to use NHibernate to connect to a Northwind database. But for some reason, I am not able to load the Entity Type. </p> <p>This is my Entity class </p> <pre><code>public class Product { public virtual Int32 ProductId { get; set; } public virtual String Desc { get; set; } } </code></pre> <p>Here is my Mapping </p> <pre><code> &lt;class name="Product" table="Products"&gt; &lt;id name="ProductId" column="ProductId" type="Int32"&gt; &lt;generator class="identity"&gt;&lt;/generator&gt; &lt;/id&gt; &lt;property name="Desc" column="ProductName" type="String" length="60"&gt; &lt;/property&gt; &lt;/class&gt; </code></pre> <p>I am getting the following error message</p> <p>could not load an entity: [OracleLinq.Product#12][SQL: SELECT product0_.ProductId as ProductId0_0_, product0_.ProductName as ProductN2_0_0_ FROM Products product0_ WHERE product0_.ProductId=?] </p> <p>Here is the stack Trace</p> <pre><code> at NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session, Object id, IType identifierType, Object optionalObject, String optionalEntityName, Object optionalIdentifier, IEntityPersister persister) at NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId) at NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session) at NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session) at NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) at NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent event, IEntityPersister persister, EntityKey keyToLoad, LoadType options) at NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent event, LoadType loadType) at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType loadType) at NHibernate.Impl.SessionImpl.ImmediateLoad(String entityName, Object id) at NHibernate.Proxy.AbstractLazyInitializer.Initialize() at NHibernate.Proxy.AbstractLazyInitializer.GetImplementation() at NHibernate.Proxy.Poco.Castle.CastleLazyInitializer.Intercept(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at ProductProxy4c67cf5bf6e640ab82d8c21a90e2a62b.set_Desc(String value) at OracleLinq.Form1.Form1_Load(Object sender, EventArgs e) </code></pre> <p>Am I doing anything wrong?</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.
 

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