NHibernate 3.2 GA + WCF Data Services = NHibernate.QueryException, Duplicate definition of alias

257 views
Skip to first unread message

-rb-

unread,
Feb 15, 2012, 10:49:56 AM2/15/12
to nhusers
Hi everybody,

I'm working on company project using NHibernate as ORM. We want to
expose our Domain Model using WCF Data Services. So I prepared custom
provider.

It seems to work, but when I try to query for related item(s) using
url query like this "http://localhost:8000/Services/oData.svc/Pool(2)/
Smtps",where Smtps is list of Smtp objects in Pool object, I get this
NHibernate.QueryException

Duplicate definition of alias 'element' ...

at
NHibernate.Hql.Ast.ANTLR.Tree.FromClause.CheckForDuplicateClassAlias(String
classAlias)
at NHibernate.Hql.Ast.ANTLR.Tree.FromClause.AddFromElement(String
path, IASTNode alias)
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.CreateFromElement(String
path, IASTNode pathNode, IASTNode alias, IASTNode propertyFetch)
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.fromElement()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.fromElementList()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.fromClause()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.unionedQuery()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.query()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.selectStatement()
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.statement()
at NHibernate.Hql.Ast.ANTLR.HqlSqlTranslator.Translate()
at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.Analyze(String
collectionRole)
at
NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.DoCompile(IDictionary`2
replacements, Boolean shallow, String collectionRole)
at NHibernate.Hql.Ast.ANTLR.QueryTranslatorImpl.Compile(IDictionary`2
replacements, Boolean shallow)
at
NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(IASTNode
ast, String queryIdentifier, String collectionRole, Boolean shallow,
IDictionary`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 shallow, IDictionary`2 enabledFilters,
ISessionFactoryImplementor factory)
at NHibernate.Engine.Query.HQLExpressionQueryPlan..ctor(String
expressionStr, IQueryExpression queryExpression, String
collectionRole, Boolean shallow, IDictionary`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.DefaultQueryProvider.PrepareQuery(Expression
expression, IQuery& query, NhLinqExpression& nhQuery)
at NHibernate.Linq.DefaultQueryProvider.Execute(Expression
expression)
at
Remotion.Linq.QueryableBase`1.System.Collections.IEnumerable.GetEnumerator()
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.HandleNonBatchRequest(RequestDescription
description)
at System.Data.Services.DataService`1.HandleRequest()

Any suggestions ?

Thanks
-rb-

Alexander Kot

unread,
Feb 24, 2012, 4:44:30 AM2/24/12
to nhu...@googlegroups.com
Hello

Please vote for
https://nhibernate.jira.com/browse/NH-2463
(exception has changed a little since I have try it last time)
Reply all
Reply to author
Forward
0 new messages