package org.mxchange.jshopcore.model.basket.items;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
* Product instance
*/
@JoinColumn (name = "product_id", updatable = false)
- @OneToOne (targetEntity = GenericProduct.class)
+ @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.MERGE)
private Product itemProduct;
/**
import java.util.Objects;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
* Parent category
*/
@JoinColumn (name = "parent_id")
- @OneToOne (targetEntity = ProductCategory.class)
+ @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
private Category parentCategory;
/**
import java.util.Calendar;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
* Id number from "contacts" table
*/
@JoinColumn (name = "contact_id", nullable = false, updatable = false, unique = true)
- @OneToOne (targetEntity = UserContact.class, optional = false)
+ @OneToOne (targetEntity = UserContact.class, cascade = CascadeType.ALL, optional = false)
private Contact contact;
/**
import java.util.Calendar;
import java.util.List;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
* Customer instance
*/
@JoinColumn (name = "customer_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = ShopCustomer.class, optional = false)
+ @OneToOne (targetEntity = ShopCustomer.class, cascade = CascadeType.MERGE, optional = false)
private Customer customer;
/**
package org.mxchange.jshopcore.model.order.items;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
* Product instance
*/
@JoinColumn (name = "product_id", updatable = false)
- @OneToOne (targetEntity = GenericProduct.class)
+ @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.MERGE)
private Product product;
/**
import java.util.Objects;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
* Product productCategory
*/
@JoinColumn (name = "category_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = ProductCategory.class, optional = false)
+ @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE, optional = false)
private Category productCategory;
/**