Arthur
Arthur

Reputation: 1176

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?

Upvotes: 4

Views: 22680

Answers (1)

Kathirvel Subramanian
Kathirvel Subramanian

Reputation: 684

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

Upvotes: 11

Related Questions