diff --git a/build.gradle.kts b/build.gradle.kts index c8e769d..923f318 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -128,6 +128,10 @@ project(":adapter") { implementation(project(":usecase")) implementation(rootProject.libs.spring.boot.starter.web) implementation(rootProject.libs.spring.boot.starter.webflux) + implementation(rootProject.libs.spring.boot.starter.data.jpa) + implementation(rootProject.libs.google.cloud.spanner.spring) + implementation(rootProject.libs.google.cloud.spanner.jdbc) + implementation(rootProject.libs.google.cloud.spanner.hibernate) testImplementation(rootProject.libs.spring.boot.starter.test) } @@ -197,6 +201,7 @@ dependencies { implementation(project(":infrastructure")) implementation(project(":usecase")) implementation(libs.spring.boot.starter) + implementation(libs.spring.boot.starter.data.jpa) implementation(libs.google.cloud.spanner.spring) implementation(libs.google.cloud.spanner.jdbc) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 730bc5c..187e249 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -26,6 +26,7 @@ spring-boot-starter-web = { module = "org.springframework.boot:spring-boot-start spring-boot-starter-webflux = { module = "org.springframework.boot:spring-boot-starter-webflux", version.ref = "spring-boot" } google-cloud-spanner-spring = "com.google.cloud:spring-cloud-gcp-starter-data-spanner:5.0.0" google-cloud-spanner-jdbc = "com.google.cloud:google-cloud-spanner-jdbc:2.15.0" +google-cloud-spanner-hibernate = "com.google.cloud:google-cloud-spanner-hibernate-dialect:3.0.3" [plugins] gradle-git-properties = "com.gorylenko.gradle-git-properties:2.4.1" diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 039f1a8..e368318 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -10,16 +10,13 @@ spring: database: ${GCP_SPANNER_DATABASE:sandbox} emulator-host: ${SPANNER_EMULATOR_HOST:localhost:9010} datasource: - url: jdbc:cloudspanner:/projects/${spring.cloud.gcp.spanner.project-id}/instances/${spring.cloud.gcp.spanner.instance-id}/databases/${spring.cloud.gcp.spanner.database} + url: jdbc:cloudspanner://${spring.cloud.gcp.spanner.emulator-host}/projects/${spring.cloud.gcp.spanner.project-id}/instances/${spring.cloud.gcp.spanner.instance-id}/databases/${spring.cloud.gcp.spanner.database} driver-class-name: com.google.cloud.spanner.jdbc.JdbcDriver jpa: hibernate: ddl-auto: update - properties: - hibernate: - dialect: com.google.cloud.spanner.hibernate.SpannerDialect - show_sql: true - format_sql: true + database-platform: com.google.cloud.spanner.hibernate.SpannerDialect + show-sql: true data: redis: host: ${REDIS_HOST:localhost}