Hibernate version:
Version of NHibernate.dll: NHibernate 1.0.2.0
Mapping documents:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="App.Core.Domain.Customer, App.Core" table="Customer">
<id name="ID" column="CustomerID">
<generator class="identity" />
</id>
<property name="FirstName" column="FirstName" />
<property name="LastName" column="LastName" />
</class>
</hibernate-mapping>
Full stack trace of any exception that occurs:
[QueryException: could not resolve property:Id of :App.Core.Domain.Customer]
NHibernate.Persister.AbstractPropertyMapping.ToType(String propertyName) +152
NHibernate.Expression.AbstractCriterion.GetType(ISessionFactoryImplementor factory, Type persistentClass, String property, IDictionary aliasClasses) +181
NHibernate.Expression.InExpression.ToSqlString(ISessionFactoryImplementor factory, Type persistentClass, String alias, IDictionary aliasClasses) +163
NHibernate.Expression.NotExpression.ToSqlString(ISessionFactoryImplementor factory, Type persistentClass, String alias, IDictionary aliasClasses) +145
NHibernate.Loader.CriteriaLoader..ctor(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl criteria) +468
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +322
NHibernate.Impl.CriteriaImpl.List() +33
App.Data.GenericNHibernateDao`1.GetByCriteria(ICriterion[] criterion) in C:\PROJECTS\ASP.NET\App\Src\Data\App.Data\GenericNHibernateDao.cs:63
AddCustomer.Page_Load(Object sender, EventArgs e) in c:\PROJECTS\ASP.NET\App\Src\App\Customer\AddCustomer.aspx.cs:37
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +31
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +68
System.Web.UI.Control.OnLoad(EventArgs e) +88
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3037
Name and version of the database you are using:
SQL Server 2005
Hi,
I have a Customer object which is derived from DomainObject. DomainObject has a property Id.
I want to get a list of customers which id's are different than a given set of customer id's. I use the following code for this.
CustomerDao.GetByCriteria(new ICriterion[] { Expression.Not(Expression.In("Id", excludedCustomers)) });
This code returns the following error:
could not resolve property:Id of :App.Core.Domain.Customer
Can't I use criteria for properties which reside in baseclasses? Like I said, the property id does not reside in the Customer object, but in the DomainObject object. When I try to use a property which does reside in the Customer object (FirstName, LastName), all goes well.
|