`

org.hibernate.QueryException: query must……的解决方案

阅读更多
在使用hibernate的query进行update时,如果提示org.hibernate.QueryException: query must begin with SELECT or FROM,不表示hibernate版本的query不支持更新,检查hibernate的配置文件会发现有个属性设置为
<property name="query.factory_class">
      org.hibernate.hql.classic.ClassicQueryTranslatorFactory
</property>
这个属性会使得hibernate不支持更新语句,如果使用executeUpdate执行更新语句就会报错。设置这个属性的是指定hibernate的hql解析器。
分享到:
评论

相关推荐

    解决SpringDataJPA报错:org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null w

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...

    org.hibernate.HibernateException: No Hibernate Session bound to thread

    Hibernate Session 绑定线程解决方案 在 Java web 开发中, Hibernate 是一个非常流行的 ORM(Object-Relational Mapping)框架,用于将 Java 对象映射到关系数据库中。然而,在使用 Hibernate 进行数据库操作时,...

    hibernate(api 介绍).pdf

    1. org.hibernate.Query Interface:用于向数据库查询对象,封装了 HQL 查询语句,和 SQL 很类似,唯一的区别在于 HQL 是面向对象的。 2. org.hibernate.Criteria Interface:完全封装了基于字符串形式的查询语句,...

    weblogic12 下 org.hibernate.hql.ast.HqlToken

    ### WebLogic 12下org.hibernate.hql.ast.HqlToken冲突解决方案 在使用WebLogic 12部署应用程序时,可能会遇到与`org.hibernate.hql.ast.HqlToken`相关的异常问题。这种异常通常与Hibernate版本之间的不兼容性有关...

    org.hibernate.ejb-library-3.4.0.GA-A

    标题 "org.hibernate.ejb-library-3.4.0.GA-A" 指示这是一个与Hibernate相关的库,特别针对EJB(Enterprise JavaBeans)版本3.4.0,并且是为OSGi环境优化的。描述中提到它适用于在Virgo Jetty服务器上进行Web开发,...

    HIbernate4.3.6整合c3p0所需jar

    org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.connections.spi.ConnectionProvider] at org.hibernate.service.internal....

    org.hibernate.ejb-library-3.4.0.GA

    标题中的"org.hibernate.ejb-library-3.4.0.GA"是Hibernate Entity Beans的一个特定版本,它是Hibernate框架的一部分,专门用于处理Java Enterprise Edition (EE)环境中的持久化。Hibernate是著名的对象关系映射...

    hibernate-validator 5.3.5.Final jar

    hibernate-validator 5.3.5.Final jar包 ;desc:if you want validator your project

    hibernate-release-5.2.16.Final.zip

    这次我们关注的是Hibernate 5.2.16.Final版本,该版本包含了完整的jar包,包括日志处理库和MySQL数据库连接库,旨在为开发者提供一站式解决方案。 一、Hibernate框架核心概念 1. **对象关系映射(ORM)**:...

    org.springframework.orm.hibernate3.LocalSessionFactoryBean

    hibernateProperties.setProperty("hibernate.dialect", "org.hibernate.dialect.MySQL5Dialect"); hibernateProperties.setProperty("hibernate.show_sql", "true"); sessionFactory.setHibernateProperties...

    weblogic10 与hibernate冲突解决方案 linux windows环境全解

    weblogic10 与hibernate冲突解决方案 错误如下:org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.HqlToken linux windows 环境解决方案全解 Linux 启动脚本添加如下: export USER_...

    hibernate(api 介绍).docx

    1. org.hibernate.Query Interface:用于向数据库查询对象以及控制执行查询的过程。Query 封装了 HQL(Hibernate Query Language)查询语句,和 SQL 很类似,唯一的区别在于 HQL 是面向对象的。 2. org.hibernate....

    hibernate-jpa-2.1-api-1.0.2.Final-API文档-中英对照版.zip

    Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开...

    ERRORLOG

    org.hibernate.TransactionException: JDBC rollback failed

    hibernate-jpa-2.1-api-1.0.2.Final-API文档-中文版.zip

    Maven坐标:org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.2.Final; 标签:hibernate、javax、persistence、jpa、api、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index...

    Hibernate不同数据库的连接及SQL方言

    Hibernate提供了多种SQL方言,例如org.hibernate.dialect.OracleDialect、org.hibernate.dialect.MySQLDialect、org.hibernate.dialect.SQLServerDialect等。我们可以在配置文件中使用元素来设置SQL方言,例如: ...

    Hibernate映射导致的几个异常

    避免这个问题的方法是在访问懒加载属性之前确保Session仍然打开,或者显式地在需要时加载属性,如使用`Hibernate.initialize()`方法。 ### 5. MappingException - **MappingException: Error reading resource**:...

    hibernate.properties

    #hibernate.query.factory_class org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory ################# ### Platforms ### ################# ## JNDI Datasource #hibernate.connection....

    HIbernate4.3.6-c3p0所需jar.rar

    Caused by: org.hibernate.boot.registry.selector.spi.StrategySelectionException: Unable to resolve name [org.hibernate.connection.C3P0ConnectionProvider] as strategy [org.hibernate.engine.jdbc.... ...

Global site tag (gtag.js) - Google Analytics