1
NHibernate 3 linq 공급자를 사용하여 항목의 최대 개수를 선택하고 싶습니다.Nhibernate 3 Linq가 Antlr.Runtime.NoViableAltException을 던졌습니다
내가 Antlr.Runtime.MismatchedTreeNodeException
int maxCount = _repository.FindAll<Device>().Max(d=>d.DeviceSensors.Count());
저장소 기능 findall은() 뒤에 Antlr.Runtime.NoViableAltException을 얻을 다음과 같은 LINQ 쿼리를 사용하면 session.Query를 반환합니다.
예외 정보 :
Antlr.Runtime.NoViableAltException occurred
Message="Exception of type 'Antlr.Runtime.NoViableAltException' was thrown."
Source="NHibernate"
Char=0
CharPositionInLine=-1
Index=21
Line=0
UnexpectedType=84
StackTrace:
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.aggregateExpr() in d:\CSharp\NH\nhibernate\src\NHibernate\Hql\Ast\ANTLR\Generated\HqlSqlWalker.cs:line 3203
InnerException:
.
Antlr.Runtime.MismatchedTreeNodeException occurred
Message="Exception of type 'Antlr.Runtime.MismatchedTreeNodeException' was thrown."
Source="Antlr3.Runtime"
Char=0
CharPositionInLine=-1
Index=21
Line=0
UnexpectedType=84
StackTrace:
at Antlr.Runtime.Tree.TreeParser.RecoverFromMismatchedToken(IIntStream input, Int32 ttype, BitSet follow)
at Antlr.Runtime.BaseRecognizer.Match(IIntStream input, Int32 ttype, BitSet follow)
at NHibernate.Hql.Ast.ANTLR.HqlSqlWalker.functionCall() in d:\CSharp\NH\nhibernate\src\NHibernate\Hql\Ast\ANTLR\Generated\HqlSqlWalker.cs:line 7906
InnerException:
NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Exception of type 'Antlr.Runtime.NoViableAltException' was thrown. [.First(.Select(.OrderByDescending(NHibernate.Linq.NhQueryable`1[RGB.TTT.Domain.Device], Quote((x,) => (x.DeviceSensors.Count)),), Quote((x,) => (new <>f__AnonymousType2`1(x.DeviceSensors.Count,))),),)]
이 알려진 문제인가? 또는 쿼리를 다시 작성해야합니다. 모든 제안을 환영합니다.