From: michael s (JIRA) <nh...@gm...> - 2011-04-25 01:37:45
|
Fetch cannot be last statement ------------------------------ Key: NH-2671 URL: http://216.121.112.228/browse/NH-2671 Project: NHibernate Issue Type: Bug Components: Linq Provider Affects Versions: 3.1.0 Reporter: michael s Priority: Major I am using WCF data services in conjuntion with Linq and received the exception whenever I try to use fetch to support the OData expand protocol. Typical query: from u in Products.Expand("Categories") select u Service Impl: public IQueryable<Product> Products { get { return _session.Query<Product>().Fetch(c => c.Categories); } } This issue was reported fixed. The alternative to append ToList and AsQueryable is not appropriate as it will lead to filtering in memory as opposed to the database. 2011-04-24 21:24:07,353 [7] ERROR - System.Data.Services.DataServiceException: Not Implemented ---> System.NotSupportedException: Specified method is not s upported. at NHibernate.Hql.Ast.ANTLR.PolymorphicQuerySourceDetector.GetClassName(IASTNode querySource) at NHibernate.Hql.Ast.ANTLR.PolymorphicQuerySourceDetector.Process(IASTNode tree) at NHibernate.Hql.Ast.ANTLR.AstPolymorphicProcessor.Process() at NHibernate.Hql.Ast.ANTLR.AstPolymorphicProcessor.Process(IASTNode ast, ISessionFactoryImplementor factory) at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IASTNode ast, String queryIdentifier, String collectionRole, Boolean shallow, ID ictionary`2 filters, ISessionFactoryImplementor factory) at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String queryIdentifier, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.HQLExpressionQueryPlan.CreateTranslators(String expressionStr, IQueryExpression queryExpression, String collectionRole, Boolean sh allow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.HQLExpressionQueryPlan..ctor(String expressionStr, IQueryExpression queryExpression, String collectionRole, Boolean shallow, IDict ionary`2 enabledFilters, ISessionFactoryImplementor factory) at NHibernate.Engine.Query.HQLExpressionQueryPlan..ctor(String expressionStr, IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters , ISessionFactoryImplementor factory) at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow, IDictionary`2 enabledFilters) at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(IQueryExpression queryExpression, Boolean shallow) at NHibernate.Impl.AbstractSessionImpl.CreateQuery(IQueryExpression queryExpression) at NHibernate.Linq.NhQueryProvider.PrepareQuery(Expression expression, IQuery& query, NhLinqExpression& nhQuery) at NHibernate.Linq.NhQueryProvider.Execute(Expression expression) at NHibernate.Linq.NhQueryProvider.Execute[TResult](Expression expression) at Remotion.Data.Linq.QueryableBase`1.GetEnumerator() at System.Data.Services.Providers.BasicExpandProvider.ExpandedQueryable`1.GetEnumerator() at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable) --- End of inner exception stack trace --- at System.Data.Services.WebUtil.GetRequestEnumerator(IEnumerable enumerable) at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService) at System.Data.Services.DataService`1.HandleRequest() -- 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 |