08-06
02
unexpected token: order near line 1, column 8
作者:Java伴侣 日期:2008-06-02
hibernate3:unexpected token: order near line 1, column 8
错误:
解决:把hql中加个from就好了
复制内容到剪贴板 程序代码
Session session = HibernateUtil.getSession();
tx = session.beginTransaction();
String hql = "delete KeyWordsVO where id=:NID";
Query query = session.createQuery(hql); //到了这里就异常
query.setInteger("NID", nId);
query.executeUpdate();
tx = session.beginTransaction();
String hql = "delete KeyWordsVO where id=:NID";
Query query = session.createQuery(hql); //到了这里就异常
query.setInteger("NID", nId);
query.executeUpdate();
错误:
复制内容到剪贴板 程序代码
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: order near line 1, column 8 [delete order.vo.KeyWordsVO where id=:NID]
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:31)
at org.hibernate.hql.ast.QuerySyntaxException.convert(QuerySyntaxException.java:24)
解决:把hql中加个from就好了
评论: 0 | 引用: 0 | 查看次数: 1777
发表评论