From 877bcf44700af3ba80a0dd23e3d69e4b04f72727 Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Wed, 8 Jun 2016 20:02:21 +0200 Subject: [PATCH] added @Transient for serial numbers as they should not be persisted under any conditions --- src/org/mxchange/jshopcore/model/basket/items/BasketItem.java | 3 +++ src/org/mxchange/jshopcore/model/category/ProductCategory.java | 3 +++ src/org/mxchange/jshopcore/model/order/ShopOrder.java | 1 + src/org/mxchange/jshopcore/model/order/items/OrderItem.java | 3 +++ src/org/mxchange/jshopcore/model/product/GenericProduct.java | 3 +++ 5 files changed, 13 insertions(+) diff --git a/src/org/mxchange/jshopcore/model/basket/items/BasketItem.java b/src/org/mxchange/jshopcore/model/basket/items/BasketItem.java index 6acdca7..9eb8201 100644 --- a/src/org/mxchange/jshopcore/model/basket/items/BasketItem.java +++ b/src/org/mxchange/jshopcore/model/basket/items/BasketItem.java @@ -26,6 +26,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; import org.mxchange.jshopcore.model.basket.AddableBasketItem; import org.mxchange.jshopcore.model.product.GenericProduct; import org.mxchange.jshopcore.model.product.Product; @@ -37,11 +38,13 @@ import org.mxchange.jshopcore.model.product.Product; */ @Entity (name = "basket_items") @Table (name = "basket_items") +@SuppressWarnings ("PersistenceUnitPresent") public class BasketItem extends BaseItem implements AddableBasketItem { /** * Serial number */ + @Transient private static final long serialVersionUID = 52_749_158_492_581_578L; /** diff --git a/src/org/mxchange/jshopcore/model/category/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/ProductCategory.java index dd7bd44..aa4bb15 100644 --- a/src/org/mxchange/jshopcore/model/category/ProductCategory.java +++ b/src/org/mxchange/jshopcore/model/category/ProductCategory.java @@ -27,6 +27,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; /** * A product category @@ -35,11 +36,13 @@ import javax.persistence.Table; */ @Entity (name = "category") @Table (name = "category") +@SuppressWarnings ("PersistenceUnitPresent") public class ProductCategory implements Category { /** * Serial number */ + @Transient private static final long serialVersionUID = 21_458_945_712_659L; /** diff --git a/src/org/mxchange/jshopcore/model/order/ShopOrder.java b/src/org/mxchange/jshopcore/model/order/ShopOrder.java index ce6d88f..1c2680f 100644 --- a/src/org/mxchange/jshopcore/model/order/ShopOrder.java +++ b/src/org/mxchange/jshopcore/model/order/ShopOrder.java @@ -48,6 +48,7 @@ public class ShopOrder implements Orderable { /** * Serial number */ + @Transient private static final long serialVersionUID = 19_728_938_459_834L; /** diff --git a/src/org/mxchange/jshopcore/model/order/items/OrderItem.java b/src/org/mxchange/jshopcore/model/order/items/OrderItem.java index 14cac31..c687fd0 100644 --- a/src/org/mxchange/jshopcore/model/order/items/OrderItem.java +++ b/src/org/mxchange/jshopcore/model/order/items/OrderItem.java @@ -28,6 +28,7 @@ import javax.persistence.Index; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; import org.mxchange.jshopcore.model.basket.AddableBasketItem; import org.mxchange.jshopcore.model.basket.items.BaseItem; import org.mxchange.jshopcore.model.product.GenericProduct; @@ -45,11 +46,13 @@ import org.mxchange.jshopcore.model.product.Product; @Index (name = "product", columnList = "order_product_id") } ) +@SuppressWarnings ("PersistenceUnitPresent") public class OrderItem extends BaseItem implements AddableBasketItem { /** * Serial number */ + @Transient private static final long serialVersionUID = 44_189_562_738_723_581L; /** diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java index b1b18e9..83db6c5 100644 --- a/src/org/mxchange/jshopcore/model/product/GenericProduct.java +++ b/src/org/mxchange/jshopcore/model/product/GenericProduct.java @@ -27,6 +27,7 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; import javax.persistence.Table; +import javax.persistence.Transient; import org.mxchange.jshopcore.model.category.Category; import org.mxchange.jshopcore.model.category.ProductCategory; @@ -38,11 +39,13 @@ import org.mxchange.jshopcore.model.category.ProductCategory; */ @Entity (name = "products") @Table (name = "products") +@SuppressWarnings ("PersistenceUnitPresent") public class GenericProduct implements Product { /** * Serial number */ + @Transient private static final long serialVersionUID = 54_578_571_769_283L; /** -- 2.39.5