]> git.mxchange.org Git - jcustomer-core.git/blobdiff - src/org/mxchange/jshopcore/model/category/ProductCategory.java
Some empty lines added/removed
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / category / ProductCategory.java
index 2fb8d0854a0aa54cdcf2c1a0a39e19a5da4dfd93..f02fb937136937d3c425c39ec19fb55d8b22019b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -18,6 +18,7 @@ package org.mxchange.jshopcore.model.category;
 
 import java.util.Objects;
 import javax.persistence.Basic;
+import javax.persistence.CascadeType;
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.GeneratedValue;
@@ -29,7 +30,7 @@ import javax.persistence.Table;
 
 /**
  * A product category
- *
+ * <p>
  * @author Roland Haeder<roland@mxchange.org>
  */
 @Entity (name = "category")
@@ -53,7 +54,7 @@ public class ProductCategory implements Category, Comparable<Category> {
         * Parent category
         */
        @JoinColumn (name = "parent_id")
-       @OneToOne (targetEntity = ProductCategory.class)
+       @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
        private Category parentCategory;
 
        /**
@@ -65,7 +66,7 @@ public class ProductCategory implements Category, Comparable<Category> {
 
        /**
         * Constructor which accepts all database fields
-        *
+        * <p>
         * @param categoryId Id number of database record
         * @param categoryTitle Category categoryTitle
         * @param parentCategory Parent category