Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set hibernate dialect for jpa in YML

I tried to set hibernate dialect for jpa in YML,

checked many topics, but it does not set:

spring:
 datasource:
  hikari:
   allow-pool-suspension: true
   connection-timeout: 1000
name: testDb
jpa:
 database: h2
 generate-ddl: false
 database-platform: h2
 package-to-scan: com.x.model
  properties:
   hibernate:
    dialect: com.x.data.core.hibernate.dialect.ExtendedH2Dialect

h2:
 console:
  enabled: true
  path: /h2

How to fix this?

like image 603
Arthur Avatar asked Oct 28 '25 17:10

Arthur


1 Answers

what is com.x.data.core.hibernate.dialect.ExtendedH2Dialect ? You have to use dialect as org.hibernate.dialect.H2Dialect

below is the sample

server:
port: 8096

spring:
  datasource:
    driverClassName: org.h2.Driver
    url: jdbc:h2:~/test
    username: sa
    password: 
    h2:
      console:
        enabled: true
  jpa:
    hibernate.ddl-auto: update
    generate-ddl: false
    show-sql: false
    properties:
      hibernate:
        dialect: org.hibernate.dialect.H2Dialect

Note: I'm using spring-boot-starter-data-jpa 2.0.5

like image 178
Kathirvel Subramanian Avatar answered Oct 31 '25 06:10

Kathirvel Subramanian



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!