diff --git a/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java b/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java index 2f72df2b..72fe0f8c 100644 --- a/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java +++ b/Workspace/core/src/main/java/com/pqt/core/entities/product/Product.java @@ -33,10 +33,14 @@ public class Product implements ILoggable, Serializable{ this.category = category; this.components = new ArrayList<>(); if(components!=null){ - this.components.addAll(components); + components.stream().forEach(p->this.components.add(new Product(p))); } } + public Product(Product p) { + this(p.id, p.name, p.amountRemaining, p.amountSold, p.sellable, p.price, p.components, p.category); + } + public long getId() { return id; }