]> 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 3b0923e8f50cba5e749e604d3bf2ec70c262975a..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")
@@ -50,10 +51,10 @@ public class ProductCategory implements Category, Comparable<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;
 
        /**
@@ -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