Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 1.2.0.4000
Mapping documents: LogicalForm with Annotations no *.hbm file available
Full stack trace of any exception that occurs:
System.Web.Services.Protocols.SoapException: The request can not be handled from the server ---> NHibernate.MappingException: Property path [SkaiForms.Visual.Domain.BO.Company.Logicalform.Property3] does not reference a collection
by NHibernate.Expression.AbstractEmptinessExpression.GetQueryableCollection(Type entityType, String actualPropertyName, ISessionFactoryImplementor factory)
by NHibernate.Expression.AbstractEmptinessExpression.ToSqlString(ICriteria criteria, ICriteriaQuery criteriaQuery, IDictionary enabledFilters)
by NHibernate.Loader.Criteria.CriteriaQueryTranslator.GetWhereCondition(IDictionary enabledFilters)
by NHibernate.Loader.Criteria.CriteriaJoinWalker..ctor(IOuterJoinLoadable persister, CriteriaQueryTranslator translator, ISessionFactoryImplementor factory, CriteriaImpl criteria, Type rootEntityName, IDictionary enabledFilters)
bei NHibernate.Loader.Criteria.CriteriaLoader..ctor(IOuterJoinLoadable persister, ISessionFactoryImplementor factory, CriteriaImpl rootCriteria, Type rootEntityName, IDictionary enabledFilters)
bei NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria, IList results)
bei NHibernate.Impl.SessionImpl.Find[T](CriteriaImpl criteria)
bei NHibernate.Impl.CriteriaImpl.List[T]()
bei SkaiForms.Visual.Data.GenericNHibernateDao`2.getByExpression(ICriterion expression, ICriterion expression2, String propertyname) in GenericNHibernateDao.cs:Line 71.
bei SkaiForms.Visual.WebService.TreeService.getPropertieTreeEntrys(String propertyFieldName, Int64 formId) in TreeService.asmx.cs:Line 118.
Name and version of the database you are using: MySQL 5
The result: I will get objects in a IList which "property3"-Field is not null and not empty.
I try to do this with the code below. But i always get an "NHibernate.MappingException". The datatype of the database field is string an is set to "NOT NULL". An empty string is possible!!
I hope you know what I mean and can help me.
Code:
ICompanyDaoFactory companyDaoFactory = new NHibernate_Company_DaoFactory();
ILogicalformDao logicalForm = companyDaoFactory.GetLogicalFormDao();
ICriterion exp = Expression.IsNotNull( propertyFieldName );
AbstractEmptinessExpression exp3 = Expression.IsNotEmpty( propertyFieldName );
IList<Logicalform> logFormList = logicalForm.getByExpression(exp, exp3, propertyFieldName );
Code:
public System.Collections.Generic.IList<T> getByExpression( ICriterion expression, ICriterion expression2, string propertyname )
{
ICriteria criteria = session.CreateCriteria( persitentType ).Add( expression ).Add( expression2 ); //throw NHibernate.MappingException
return criteria.List<T>();
}
greetz mknoppik