From 1b5a2c176c679af8eb8019d076de746917a75776 Mon Sep 17 00:00:00 2001 From: mrfoxygmfr Date: Sun, 23 Mar 2025 23:23:12 +0300 Subject: fix(db/models): Revert "fix(db/models): change primary key strategy and remove extra NotNull annotations" This reverts commit 20255f9fd6f126077d3cb51ac003c166221d4015. --- .../mrfoxygmfr/warehouse_accounting/db/models/OperationProducts.java | 1 + .../java/ru/mrfoxygmfr/warehouse_accounting/db/models/Product.java | 3 +++ .../ru/mrfoxygmfr/warehouse_accounting/db/models/ProductSlots.java | 1 + .../java/ru/mrfoxygmfr/warehouse_accounting/db/models/StorageSlot.java | 3 +++ 4 files changed, 8 insertions(+) diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/OperationProducts.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/OperationProducts.java index 837e42e..9eaeab1 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/OperationProducts.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/OperationProducts.java @@ -28,5 +28,6 @@ public class OperationProducts { private Product product; @Column(nullable = false, name = "amount") + @NonNull private long amount; } 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 23c4c6a..5211eaf 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 @@ -30,12 +30,15 @@ public class Product { private ProductType type; @Column(nullable = false, name = "height") + @NonNull private long height; @Column(nullable = false, name = "width") + @NonNull private long width; @Column(nullable = false, name = "depth") + @NonNull private long depth; @Column(nullable = true, name = "max_storage_duration", columnDefinition = "interval") diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/ProductSlots.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/ProductSlots.java index 6ed814f..7c24e5b 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/ProductSlots.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/ProductSlots.java @@ -31,6 +31,7 @@ public class ProductSlots { private StorageSlot slot; @Column(nullable = false, name = "amount") + @NonNull private long amount; @Column(nullable = false, name = "status") diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/StorageSlot.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/StorageSlot.java index 74253c0..7486b21 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/StorageSlot.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/StorageSlot.java @@ -22,11 +22,14 @@ public class StorageSlot { private String location; @Column(nullable = false, name = "height") + @NonNull private long height; @Column(nullable = false, name = "width") + @NonNull private long width; @Column(nullable = false, name = "depth") + @NonNull private long depth; } -- cgit mrf-deployment