/*
- * Copyright (C) 2015 Roland Haeder
+ * Copyright (C) 2016 Roland Haeder
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import java.util.Objects;
import javax.persistence.Basic;
+import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
/**
* A product category
- *
+ * <p>
* @author Roland Haeder<roland@mxchange.org>
*/
@Entity (name = "category")
private Long categoryId;
/**
- * Parent category categoryId
+ * Parent category
*/
@JoinColumn (name = "parent_id")
- @OneToOne (targetEntity = ProductCategory.class)
+ @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
private Category parentCategory;
/**
/**
* Constructor which accepts all database fields
- *
+ * <p>
* @param categoryId Id number of database record
* @param categoryTitle Category categoryTitle
* @param parentCategory Parent category