Reputation: 33
When I run my SpringBoot (3.2.2) project it works all fine. I just got in terminal the following warning:
How can I update it? Is it just a depencency to update (version) in POM.xml? Thank you
My depencency
<dependency>
<!-- Oracle - OJDBC -->
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
<scope>runtime</scope>
</dependency>
and here my application.properties
# JPA Settings
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.OracleDialect
My Hibernate Core version is: 6.4.1
Upvotes: 3
Views: 13156
Reputation: 21
use this dialect in your application.yml
jpa:
properties:
hibernate:
dialect: org.hibernate.community.dialect.OracleLegacyDialect
add this dependency in your pom.xml
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-community-dialects</artifactId>
</dependency>
Upvotes: 2
Reputation: 71
Dialect for older DB's like Oracle 10g are no longer available in hibernate-core. According to documentation older version were moved to hibernate-community-dialects.
So to fix this, add following artifact to project (If you're using maven) I would use version with corresponding version to core
<!-- https://mvnrepository.com/artifact/org.hibernate.orm/hibernate-community-dialects -->
<dependency>
<groupId>org.hibernate.orm</groupId>
<artifactId>hibernate-community-dialects</artifactId>
<version>6.4.4.Final</version>
</dependency>
And to make this work you need to add info about used dialect. Hence library has changed you need to point to proper dialect class in package org.hibernate.community.dialect
spring.jpa.database-platform=org.hibernate.community.dialect.<here your dialect>
Here is configuration for LocalContainerEntityManagerFactoryBean (in case you're using multiple datasources)
@Bean()
public LocalContainerEntityManagerFactoryBean oracleEntityManagerFactory(EntityManagerFactoryBuilder builder) {
Map<String, Object> properties = new HashMap<String, Object>();
properties.put("hibernate.dialect", "org.hibernate.community.dialect.OracleLegacyDialect");
return builder
.dataSource(oracleDataSource())
.packages("com.packages.with.entities.that.will.be.assinged.to.this.emf")
.persistenceUnit("oracle-PU")
.properties(properties)
.build();
}
Upvotes: 7
Reputation: 31
Starting from Hibernate version 6.0, the legacy dialects like Oracle12cDialect have been moved to a separate artifact, called hibernate-community-dialects. You can add the dependency for this artifact in your project, and set application.properties like this -
spring.jpa.database-platform=org.hibernate.community.dialect.Oracle12cDialect
Upvotes: 3
Reputation: 14
It seems like you need to update the oracle database to at least version 19! but this solution is not feasible for me. Therefore, I resolved this issue by downgrading the hibernate version to 6.2.
<properties>
<hibernate.version>6.2.21.Final</hibernate.version>
</properties>
Upvotes: -1