diff options
author | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-03-24 01:31:05 +0300 |
---|---|---|
committer | mrfoxygmfr <mrfoxygmfr@sch9.ru> | 2025-03-24 01:31:05 +0300 |
commit | e40750eb6ff6d8f78a092257669fd5dddc106df3 (patch) | |
tree | eea94769942ffc130446120d41ef2a17c996a1dc | |
parent | 1b5a2c176c679af8eb8019d076de746917a75776 (diff) |
fix(db/models): fix INTERVAL type handling
-rw-r--r-- | build.gradle.kts | 1 | ||||
-rw-r--r-- | src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index e972072..8b71ebc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,6 +29,7 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-web") implementation("org.springframework.boot:spring-boot-starter-data-jpa") implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("io.hypersistence:hypersistence-utils-hibernate-63:3.9.5") compileOnly("org.projectlombok:lombok") compileOnly("jakarta.persistence:jakarta.persistence-api") diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java index 5211eaf..420a615 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java @@ -1,5 +1,7 @@ package ru.mrfoxygmfr.warehouse_accounting.db.models; +import io.hypersistence.utils.hibernate.type.interval.PostgreSQLIntervalType; +import org.hibernate.annotations.Type; import jakarta.persistence.*; import lombok.*; @@ -42,7 +44,7 @@ public class Product { private long depth; @Column(nullable = true, name = "max_storage_duration", columnDefinition = "interval") - @NonNull + @Type(PostgreSQLIntervalType.class) private Duration maxStorageDuration; } |