`
lhx1026
  • 浏览: 310130 次
  • 性别: Icon_minigender_2
  • 来自: 广州
社区版块
存档分类
最新评论

org.hibernate.QueryException: query must begin with SELECT or FROM

阅读更多

出现这样的错误是由于HQL解释器使用的是 2.x的版本。

 

  • 2.x :hibernate.query.factory_class=org.hibernate.hql.classic.ClassicQueryTranslatorFactory   
  • 3.x:hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory  
    使用 3.x的版本的 factory_class 就ok了
  • 分享到:
    评论

    相关推荐

      解决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/...

      hibernate(api 介绍).pdf

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

      ERRORLOG

      org.hibernate.TransactionException: JDBC rollback failed

      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....

      hibernate-validator 5.3.5.Final jar

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

      org.springframework.orm.hibernate3.LocalSessionFactoryBean

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

      hibernate(api 介绍).docx

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

      hibernate.properties

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

      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**:...

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

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

      org.hibernate.jpa.QueryHints jar包

      org.hibernate.jpa.QueryHints jar hibernate-entitymanager-4.3.0.Final.jar

      hibernate-validator-6.0.18.Final-sources.jar

      java运行依赖jar包

      hibernate-src.zip源代码包

      3. **org.hibernate.boot** 包:这部分涉及Hibernate的启动过程和元数据加载,比如`MetadataSources`和`MetadataBuilder`,它们负责从不同来源(如XML配置文件、注解等)收集元数据。 4. **org.hibernate.type** 包...

      maven+hibernate

      8. **查询**: Hibernate支持HQL(Hibernate Query Language)和 Criteria API,它们提供了面向对象的查询方式。另外,还可以使用原生的SQL查询并通过`@NamedNativeQuery`进行配置。 在这个"Spring4Hibernate5MVC...

      com.microsoft.sqlserver.jdbc.SQLServerException: 只进结果集不支持请求的操作 解决方案

      query.setHint("org.hibernate.fetchSize", 20); // 设置查询结果集大小 query.setFetchSize(20); List<Game> games = query.list(); tx.commit(); } catch (HibernateException e) { if (tx != null) { tx....

      hibernate annotations

      1. **配置**:首先,需要在项目中引入Hibernate库,并创建一个配置文件(通常是hibernate.cfg.xml),配置数据库连接信息。 2. **实体定义**:使用注解定义实体类及其属性,指定与数据库表的对应关系。 3. **...

      hibernate jar包

      - `org.hibernate.Query`和`org.hibernate.Criteria`:用于执行HQL和Criteria查询。 - `org.hibernate.annotations`包下的注解:如@Entity、@Table、@Column等,定义实体和属性的映射规则。 4. 使用Hibernate的...

    Global site tag (gtag.js) - Google Analytics