转自:http://k0441258778983.iteye.com/blog/1042580
hibernate自带HQL一般只用于查询语句;
而增删改需要在query执行之后再调用query.executeUpdate();
但是经测试后一直报异常如下:
org.hibernate.QueryException: query must begin with SELECT or FROM: delete
经过网上查询其原因是:
hibernate 配置文件hibernate.cfg.xml里 解析hibernate 查询语言为2.X版本,
即:
<property name="hibernate.query.factory_class">
org.hibernate.hql.classic.ClassicQueryTranslatorFactory </property>
将其改为3.X
<property name="hibernate.query.factory_class">
org.hibernate.hql.ast.ASTQueryTranslatorFactory
</property> 即可!
相关推荐
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...
No Hibernate Session bound to thread,没有绑定线程解决办法,找了好久才找到的
org.hibernate.TransactionException: JDBC rollback failed
org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....
weblogic12 下最新 org.hibernate.hql.ast.HqlToken解决办法
hibernate-validator 5.3.5.Final jar包 ;desc:if you want validator your project
Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开...
#hibernate.query.factory_class org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory ################# ### Platforms ### ################# ## JNDI Datasource #hibernate.connection....
NULL 博文链接:https://hw1287789687.iteye.com/blog/1967701
weblogic10 与hibernate冲突解决方案 错误如下:org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken linux windows 环境解决方案全解 Linux 启动脚本添加如下: export USER_...
org.hibernate.jpa.QueryHints jar hibernate-entitymanager-4.3.0.Final.jar
整合了hibernate所需的全套jar包包括日志jar包以及mysql的连接jar包,希望对大家有所帮助
Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.... ...
myeclipse的自带hibernate jar包不支持注解;自己找的hibernate注解所需的jar包:hibernate-core;hibernate-annotation;hbm-cfg-xml;log4j.properties
解决org.hibernate.LazyInitializationException: could not initialize proxy - no Session...
Hibernate映射导致的几个常见异常
官网hibernate:问题说明: 1、安装整合通过; 2、整合时注意javassist-3.22.0-GA.jar与struts2.4的 javassist-3.20.0-GA.jar重复; 3、整合所需基础包以及整合需要的外部包,自己放到一个新建文件夹中,方便大家...
包含hibernate所有所需jar包还有一些其他包日志包、jpa支持包等: 列如:hibernate-core-5.1.0.Final.jar hibernate-ehcache-5.1.0.Final.jar hibernate-entitymanager-5.1.0.Final.jar hibernate-envers-5.1.0....
Class'org.springframework.orm.hibernate3.LocalSessionFactoryBean'not found 解决办法