NHibernate를 사용하여 Northwind 데이터베이스에 연결하려고합니다. 그러나 어떤 이유로 엔티티 유형을로드 할 수 없습니다. NHibernate의 매핑 오류
이
은 여기에 다음과 같은 오류 메시지가 무엇입니까<class name="Product" table="Products">
<id name="ProductId" column="ProductId" type="Int32">
<generator class="identity"></generator>
</id>
<property name="Desc" column="ProductName" type="String" length="60">
</property>
</class>
내 매핑 내 Entity 클래스
public class Product
{
public virtual Int32 ProductId { get; set; }
public virtual String Desc { get; set; }
}
입니다
엔티티를로드 할 수 없습니다 : [OracleLinq.Product # 12 ] [SQL : product0_.ProductId를 ProductId0_0_으로, product0_.ProductName을 ProductN2_0_0_ 제품으로 product0_ WH where product0_.ProductId =?]
여기는
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)
내가 뭔가 잘못을하고 있습니까 스택 추적을입니까?
예외 내부에 예외가 있습니까? –
일반적으로이 nhibernate 오류가 발생할 때마다 Sql Management Studio에서 SQL (매개 변수가 바뀌 었음)을 복사하여 붙여 넣기를 시도하여 어리석은 짓을하지 않고 열을 잘못 입력했는지 확인합니다. – Min