diff options
7 files changed, 7 insertions, 15 deletions
diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Operation.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Operation.java index 51b8bbd..1f5b911 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Operation.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Operation.java @@ -16,7 +16,7 @@ import java.util.Set; @AllArgsConstructor public class Operation { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; 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 9eaeab1..0842437 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 @@ -13,7 +13,7 @@ import lombok.*; @AllArgsConstructor public class OperationProducts { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; @@ -28,6 +28,5 @@ 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/Partner.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Partner.java index 78f203c..13d24c0 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Partner.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/Partner.java @@ -15,7 +15,7 @@ import java.util.Set; @AllArgsConstructor public class Partner { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; diff --git a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/PartnerContact.java b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/PartnerContact.java index e25d178..2299e8e 100644 --- a/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/PartnerContact.java +++ b/src/main/java/ru/mrfoxygmfr/warehouse_accounting/db/models/PartnerContact.java @@ -13,7 +13,7 @@ import lombok.*; @AllArgsConstructor public class PartnerContact { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; 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..3d97271 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 @@ -16,7 +16,7 @@ import java.time.Duration; @AllArgsConstructor public class Product { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; @@ -30,15 +30,12 @@ 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 7c24e5b..4065dc8 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 @@ -15,7 +15,7 @@ import java.sql.Timestamp; @AllArgsConstructor public class ProductSlots { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; @@ -31,7 +31,6 @@ 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 7486b21..424cab2 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 @@ -13,7 +13,7 @@ import lombok.*; @AllArgsConstructor public class StorageSlot { @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) + @GeneratedValue(strategy = GenerationType.AUTO) @Column(nullable = false, name = "id") private int id; @@ -22,14 +22,11 @@ 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; } |