From: Michael K. (JIRA) <nh...@gm...> - 2010-10-08 19:40:40
|
[ http://216.121.112.228/browse/NH-2328?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20000#action_20000 ] Michael Kobaly commented on NH-2328: ------------------------------------ Sorry about the confusion. Yes originally I was looking to use linq but that did not work. I got much closer using QueryOver but that still fails. I have tried out the latest Alpha 3 version and now I get a different error using QueryOver. This time it seems to get further but it still fails. Here is the test from that attached zip file I originally added. [Test] public void Linq_Find_All_Circles_Throws_Error() { using (ISession session = this.OpenSession()) { IList<ToyBox> results = session.QueryOver<ToyBox>() .Where(x => x.Shape is Circle).List(); Assert.IsNotNull(results); } } Here is the error (Unable to cast object of type 'System.RuntimeType' to type 'System.String') -- Full error below --- NHibernate.Exceptions.GenericADOException : could not execute query [ SELECT this_.toybox_id as toybox1_3_0_, this_.name as name3_0_, this_.s_object_id as s3_3_0_, this_.object_id as object4_3_0_ FROM toyBox this_ WHERE this_.s_object_id = ? ] Positional parameters: #0>NHibernate.Test.NHSpecificTest.NH1234.Circle [SQL: SELECT this_.toybox_id as toybox1_3_0_, this_.name as name3_0_, this_.s_object_id as s3_3_0_, this_.object_id as object4_3_0_ FROM toyBox this_ WHERE this_.s_object_id = ?] ----> System.InvalidCastException : Unable to cast object of type 'System.RuntimeType' to type 'System.String'. at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.ListIgnoreQueryCache(ISessionImplementor session, QueryParameters queryParameters) at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet`1 querySpaces, IType[] resultTypes) at NHibernate.Loader.Criteria.CriteriaLoader.List(ISessionImplementor session) at NHibernate.Impl.SessionImpl.List(CriteriaImpl criteria, IList results) at NHibernate.Impl.CriteriaImpl.List(IList results) at NHibernate.Impl.CriteriaImpl.List[T]() at NHibernate.Criterion.QueryOver`1.List() at NHibernate.Criterion.QueryOver`1.NHibernate.IQueryOver<TRoot>.List() NHSpecificTest\NH1234\Tests.cs(81,0): at NHibernate.Test.NHSpecificTest.NH1234.SampleTest.Linq_Find_All_Circles_Throws_Error() --InvalidCastException at NHibernate.Type.MetaType.NullSafeSet(IDbCommand st, Object value, Int32 index, ISessionImplementor session) at NHibernate.Engine.QueryParameters.BindParameters(IDbCommand command, Int32 start, ISessionImplementor session) at NHibernate.Loader.Loader.BindParameterValues(IDbCommand statement, QueryParameters queryParameters, Int32 startIndex, ISessionImplementor session) at NHibernate.Loader.Loader.PrepareQueryCommand(QueryParameters queryParameters, Boolean scroll, ISessionImplementor session) at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies) at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters) > Linq query on <Any/> fails > -------------------------- > > Key: NH-2328 > URL: http://216.121.112.228/browse/NH-2328 > Project: NHibernate > Issue Type: Bug > Components: QueryOver > Affects Versions: 3.0.0.Alpha2 > Reporter: Michael Kobaly > Assignee: Richard Brown > Priority: Major > Attachments: NHibernate.Test.zip > > > Please read NHUsers group posting here for description of problem. > http://groups.google.com/group/nhusers/browse_thread/thread/fa831bd703842e1e > I excluded the lib folder from the zip file since upload says not to include dlls. I am using NH 3 Alpha 2 with all supporting dlls. First time posting bug..sorry in advance if I am doing it wrong. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |