目前我正在尝试升级我的Spring启动应用程序以使用Hibernate 5.2,因此春季启动会自动使用5.0和JPA。我希望5.2更好地支持Java 8时间对象。我没有找到一个明确的方法,我需要添加到我的gradle.build文件的依赖项,这些是与数据相关的依赖项:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile group: 'com.zaxxer', name: 'HikariCP', version: '2.6.1'
应用程序属性:
#first db
spring.datasource.driver-class-name = org.postgresql.Driver
spring.datasource.url = jdbc\:postgresql\://localhost/nuid
spring.datasource.username = nuid
spring.datasource.password = nuid
spring.datasource.type = com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.connection-test-query = SELECT 1
spring.datasource.hikari.minimum-idle = 1
spring.datasource.hikari.maximum-pool-size = 5
spring.datasource.hikari.pool-name = nonUserPool
spring.jpa.hibernate.naming.implicit-strategy =
org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
# General JPA properties
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQLDialect
spring.jpa.show-sql=false
# Hibernate Specific properties
spring.jpa.properties.hibernate.format_sql=true
spring.jpa.hibernate.ddl-auto=create-drop