简体   繁体   English

当我尝试使用DML更新表时,NHibernate抛出此错误'NHibernate.Hql.Ast.ANTLR.QuerySyntaxException'

[英]NHibernate throws this error 'NHibernate.Hql.Ast.ANTLR.QuerySyntaxException' when I'm trying to update a table using DML

I don't know what I'm doing wrong here and I'd like to know what's wrong with code below: 我不知道我在做什么错,我想知道下面的代码出了什么问题:

var hqlUpdate = "UPDATE Enrollment SET status = 'Approved' WHERE Id = :studentId && Level = :level && Semester = :semester";
        Database.Session.CreateQuery(hqlUpdate)
            .SetParameter("studentId", id)
            .SetString("level", studentLevel)
            .SetString("semester", semester)
            .ExecuteUpdate();

Please replace && with and . 请更换&&and I dont think HQL supports && 我不认为HQL支持&&

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 外部项目中的Nhibernate模型:NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:类未映射 - Nhibernate Models in external Project: NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: Class is not mapped 在同一解决方案中将公共代码移至公共项目后,获取NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:“未映射空缺” - Getting NHibernate.Hql.Ast.ANTLR.QuerySyntaxException: 'Vacancy is not mapped' after moving common code to a Common Project in the same solution 使用NHibernate HQL时是否需要显式刷新 - Do I need to explicitly Flush when using NHibernate HQL 自定义LinqToHqlGeneratorsRegistry-InvalidCastException:'无法将“ Antlr.Runtime.Tree.CommonTree”强制转换为“ NHibernate.Hql.Ast.ANTLR.Tree.IASTNode” - Custom LinqToHqlGeneratorsRegistry - InvalidCastException: 'Unable cast “Antlr.Runtime.Tree.CommonTree” to “NHibernate.Hql.Ast.ANTLR.Tree.IASTNode” 无法将类型为'NHibernate.Hql.Ast.HqlBitwiseAnd'的对象强制转换为'NHibernate.Hql.Ast.HqlBooleanExpression' - Unable to cast object of type 'NHibernate.Hql.Ast.HqlBitwiseAnd' to type 'NHibernate.Hql.Ast.HqlBooleanExpression' 无法将'NHibernate.Hql.Ast.HqlCast'类型的对象强制转换为'NHibernate.Hql.Ast.HqlBooleanExpression - Unable to cast object of type 'NHibernate.Hql.Ast.HqlCast' to type 'NHibernate.Hql.Ast.HqlBooleanExpression NHibernate异常:无法将类型为“ NHibernate.Hql.Ast.HqlParameter”的对象转换为类型为“ NHibernate.Hql.Ast.HqlBooleanExpression”的对象 - NHibernate Exception: Unable to cast object of type 'NHibernate.Hql.Ast.HqlParameter' to type 'NHibernate.Hql.Ast.HqlBooleanExpression' 使用QueryOver HQL的NHibernate查询 - NHibernate Query using QueryOver HQL NHibernate中没有HQL模式的更新方法 - Update method without HQL mode in NHibernate NHibernate 使用 SQLite 进行测试 - 使用异步方法时没有此类表错误 - NHibernate tests with SQLite - no such table error when using async methods
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM