diff options
-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; } |