首页 > Web开发 > 详细

idea hibernate console 执行hql报错

时间:2019-08-29 14:53:25      阅读:104      评论:0      收藏:0      [点我收藏+]

报错信息

hql> select a from GDXMZD a
[2019-08-29 13:45:01] org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
[2019-08-29 13:45:01] java.lang.RuntimeException: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect‘ not set
[2019-08-29 13:45:01] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
[2019-08-29 13:45:01] at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
[2019-08-29 13:45:01] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
[2019-08-29 13:45:01] at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)

技术分享图片

 

 1 首先检查实体是否关联了数据源

技术分享图片

2 检查数据库是否连接

技术分享图片

3 检查application.yaml 或配置文件中是否配置了hibernate方言

postgresql

dialect: org.hibernate.dialect.PostgreSQL95Dialect

技术分享图片

 

 4 其他问题

 

参考:

1  https://www.jetbrains.com/help/idea/working-with-the-persistence-tool-window.html#assign_data_source

 2 https://intellij-support.jetbrains.com/hc/en-us/community/posts/360001876979-JPA-Console-hibernate-dialect-not-set-error-during-a-query-to-Sql-Server-table

idea hibernate console 执行hql报错

原文:https://www.cnblogs.com/wolbo/p/11429469.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!