- CascadeType.MERGE is basicly an UPDATE statement, it needs to be REFRESH (from database to local entity object)
- Fetch strategy EAGER is default, no need to specify it
- updated jar(s)
* Product instance
*/
@JoinColumn (name = "product_id", updatable = false)
- @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.REFRESH)
private Product itemProduct;
/**
* Parent category
*/
@JoinColumn (name = "parent_id")
- @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH)
private Category parentCategory;
/**
import java.io.Serializable;
/**
- * An enum for customer's account status like confirmed, locked, etc.
+ * An enumeration for customer's account status like confirmed, locked, etc.
* <p>
* @author Roland Haeder<roland@mxchange.org>
*/
CONFIRMED("CUSTOMER_ACCOUNT_STATUS_CONFIRMED"), //NOI18N
/**
- * Locked (maybe violeted T&C)
+ * Locked (maybe violated T&C)
*/
LOCKED("CUSTOMER_ACCOUNT_STATUS_LOCKED"); //NOI18N
* Customer instance
*/
@JoinColumn (name = "customer_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = ShopCustomer.class, cascade = CascadeType.MERGE, optional = false)
+ @OneToOne (targetEntity = ShopCustomer.class, cascade = CascadeType.REFRESH, optional = false)
private Customer customer;
/**
* Product instance
*/
@JoinColumn (name = "order_product_id", updatable = false)
- @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.MERGE)
+ @OneToOne (targetEntity = GenericProduct.class, cascade = CascadeType.REFRESH)
private Product product;
/**
* Product productCategory
*/
@JoinColumn (name = "category_id", nullable = false, updatable = false)
- @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE, optional = false)
+ @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH, optional = false)
private Category productCategory;
/**