报错:
org.springframework.dao.InvalidDataAccessApiUsageException: org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for DML operations [delete from cn.lzh.springdata.pojo.Student s where s.studentName=:studentName]; nested exception is java.lang.IllegalStateException: org.hibernate.hql.internal.QueryExecutionRequestException: Not supported for DML operations [delete from cn.lzh.springdata.pojo.Student s where s.studentName=:studentName]
解决方法:
springdata中接口方法中注意要打上注解:
@Transactional
//事物
@Modifying
//对DML支持