gpt4 book ai didi

hibernate - 由 : org. hibernate.HibernateException : Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set. 引起

转载 作者:行者123 更新时间:2023-12-02 09:12:33 27 4
gpt4 key购买 nike

即使设置 hibernate.dialect 属性后,我也会遇到异常。我使用的是 hibernate 5.0.11 和 spring boot 1.4.2,mysql 版本为 5.7

application.properties is like this

# Hibernate
hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
hibernate.show_sql=true
hibernate.hbm2ddl.auto=validate

pom.xml

    <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-aop</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

这里有什么问题吗?

最佳答案

当我遇到该错误时,将以下行添加到 properties 文件中可以解决此问题。

spring.jpa.database=mysql

关于hibernate - 由 : org. hibernate.HibernateException : Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set. 引起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40779664/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com