Hi,
I have the following situation:
- An entity with some "many-to-one" associations and a "one-to-many" association.
(I can send you the files and classes)
- When i define a criteria like this:
ICriteria criteria = session.CreateCriteria(typeof(MYENTITY));
criteria.SetTimeout(5000);
criteria.SetMaxResults(50);
criteria.SetFetchMode(MYENTITY_ONE_TO_MANY_PROPERTY_NAME, NHibernate.FetchMode.Join);
criteria.SetFetchMode(MYENTITY_MANY_TO_ONE_PROPERTY_NAME, NHibernate.FetchMode.Eager);
and then execute the query:
IList result = criteria.List();
I get the following error:"could not execute query..."
(innerException: "identifier type mismatch\r\nParameter name: id")
(StackTrace: " at NHibernate.Engine.EntityKey..ctor(Object id, Object identifierSpace, Type clazz, IType identifierType, Boolean isBatchLoadable, ISessionFactoryImplementor factory)\r\n at NHibernate.Engine.EntityKey..ctor(Object id, IEntityPersister p)\r\n at NHibernate.Loader.Loader.RegisterNonExists(EntityKey[] keys, ILoadable[] persisters, ISessionImplementor session)\r\n at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, LockMode[] lockModeArray, EntityKey optionalObjectKey, IList hydratedObjects, EntityKey[] keys, Boolean returnProxies)\r\n at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)\r\n at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)\r\n at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)")
So, what's wrong? Is this a bug?
Regards...
|