]> git.mxchange.org Git - jcustomer-core.git/blobdiff - src/org/mxchange/jshopcore/model/category/ProductCategory.java
Added dummy compareTo() (unimplemented, will follow) and Comparable<SomeInterface...
[jcustomer-core.git] / src / org / mxchange / jshopcore / model / category / ProductCategory.java
index f02fb937136937d3c425c39ec19fb55d8b22019b..721e638fef6e124c198b8e8a7bf4e723a71f451f 100644 (file)
@@ -50,13 +50,6 @@ public class ProductCategory implements Category, Comparable<Category> {
        @Column (name = "category_id", length = 20, nullable = false)
        private Long categoryId;
 
-       /**
-        * Parent category
-        */
-       @JoinColumn (name = "parent_id")
-       @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
-       private Category parentCategory;
-
        /**
         * Title of category
         */
@@ -64,6 +57,13 @@ public class ProductCategory implements Category, Comparable<Category> {
        @Column (name = "category_title", length = 100, nullable = false, unique = true)
        private String categoryTitle;
 
+       /**
+        * Parent category
+        */
+       @JoinColumn (name = "parent_id")
+       @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.MERGE)
+       private Category parentCategory;
+
        /**
         * Constructor which accepts all database fields
         * <p>
@@ -122,22 +122,22 @@ public class ProductCategory implements Category, Comparable<Category> {
        }
 
        @Override
-       public Category getParentCategory () {
-               return this.parentCategory;
+       public String getCategoryTitle () {
+               return this.categoryTitle;
        }
 
        @Override
-       public void setParentCategory (final Category parentCategory) {
-               this.parentCategory = parentCategory;
+       public void setCategoryTitle (final String categoryTitle) {
+               this.categoryTitle = categoryTitle;
        }
 
        @Override
-       public String getCategoryTitle () {
-               return this.categoryTitle;
+       public Category getParentCategory () {
+               return this.parentCategory;
        }
 
        @Override
-       public void setCategoryTitle (final String categoryTitle) {
-               this.categoryTitle = categoryTitle;
+       public void setParentCategory (final Category parentCategory) {
+               this.parentCategory = parentCategory;
        }
 }