0
예외 "지원되지 않는 특정 방법"와 함께 실패NHibernate에 HQL 일괄 업데이트는 주문 엔티티에 대한 HQL 일괄 업데이트를 수행하려고 할 때, 나는 다음과 같은 예외가 받고 있어요
Specified method is not supported.
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, IDictionary`2 filters, ISessionFactoryImplementor factory)
at NHibernate.Hql.Ast.ANTLR.ASTQueryTranslatorFactory.CreateQueryTranslators(String queryString, String collectionRole, Boolean shallow, IDictionary`2 filters, ISessionFactoryImplementor factory)
at NHibernate.Engine.Query.HQLStringQueryPlan.CreateTranslators(String hql, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory)
at NHibernate.Engine.Query.HQLStringQueryPlan..ctor(String hql, String collectionRole, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory)
at NHibernate.Engine.Query.HQLStringQueryPlan..ctor(String hql, Boolean shallow, IDictionary`2 enabledFilters, ISessionFactoryImplementor factory)
at NHibernate.Engine.Query.QueryPlanCache.GetHQLQueryPlan(String queryString, Boolean shallow, IDictionary`2 enabledFilters)
at NHibernate.Impl.AbstractSessionImpl.GetHQLQueryPlan(String query, Boolean shallow)
at NHibernate.Impl.AbstractSessionImpl.CreateQuery(String queryString)
at ...Repositories.OrderRepository.MarkAsConfirmed(IEnumerable`1 orderIds) in C:\Users\Miroslav\Documents\Projects\...\OrderRepository.cs:line 40
at ConfirmationUploadTask.Execute()
참고 그 주문 엔티티 에 매핑됩니다. 주문 테이블이므로 은이 예약어 관련 문제가 아니어야합니다. 다른 LINQ 2 NHibernate 기반 쿼리가 제대로 작동하고 있습니다. Order 대신 다른 매핑 된 엔터티를 사용하면 쿼리가 작동합니다.
나는 또한 hbm2ddl.keywords=auto-quote
as mentioned by Fabio으로 시도했지만 행운은 없습니다. 대신 CreateSQLQuery를 사용하는 경우
var query = GetSession().CreateQuery(
"update Order set IsConfirmed = :isConfirmed where id in (:ids)");
, 그것은 오류없이 작동합니다 :
var query = GetSession().CreateSQLQuery(
"UPDATE Orders SET IsConfirmed = :isConfirmed WHERE OrderId in (:ids)");
모든 아이디어를 참고로
,이 쿼리의 모습인가?
고마워요! 해결 방법은 예상대로 작동했습니다. JIRA에 버그를 제출했습니다 : http://216.121.112.228/browse/NH-2562 –