hibernate删除语句问题
数据库项含有,id,name,phone等信息,现知道不重复的name,根据name删除这一项纪录,主要代码如下,
com.adk.vo.Delete是一个类,包含了id,name,phone等的set get方法
String hql = "delete from com.adk.vo.Delete where name='"+ name + "'";
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
tx = session.beginTransaction();
Query q = session.createQuery(hql);
session.close();
运行无法删除,显示异常Not supported for DML operations
应该是hql写得不对吧,我想知道哪里错了。