]> git.mxchange.org Git - jshop-core.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 15 Apr 2017 17:08:25 +0000 (19:08 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 15 Apr 2017 19:09:44 +0000 (21:09 +0200)
- some classes, interfaces, events and exceptions were not shop-specific and
  can be moved out to new project jproduct-core (same later with jshop-ee-lib).
- for example, jfiancials will not use shopping basket class but may only need
  product and category classes/interfaces. Then it is better to have these
  moved out to separate project.
- commons-codec is now referenced as library, not a single JAR
- jproduct-core added

Signed-off-by: Roland Häder <roland@mxchange.org>
22 files changed:
lib/commons-codec-1.10.jar [deleted file]
lib/commons-codec/commons-codec-1.10.jar [new file with mode: 0644]
lib/jproduct-core.jar [new file with mode: 0644]
lib/nblibraries.properties
nbproject/project.properties
src/org/mxchange/jshopcore/events/category/AddedCategoryEvent.java [deleted file]
src/org/mxchange/jshopcore/events/category/ShopCategoryAddedEvent.java [deleted file]
src/org/mxchange/jshopcore/events/product/AddedProductEvent.java [deleted file]
src/org/mxchange/jshopcore/events/product/ShopProductAddedEvent.java [deleted file]
src/org/mxchange/jshopcore/exceptions/CannotAddCategoryException.java [deleted file]
src/org/mxchange/jshopcore/exceptions/CannotAddProductException.java [deleted file]
src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java [deleted file]
src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java [deleted file]
src/org/mxchange/jshopcore/model/basket/AddableBasketItem.java
src/org/mxchange/jshopcore/model/basket/items/BaseItem.java
src/org/mxchange/jshopcore/model/basket/items/BasketItem.java
src/org/mxchange/jshopcore/model/category/Category.java [deleted file]
src/org/mxchange/jshopcore/model/category/ProductCategory.java [deleted file]
src/org/mxchange/jshopcore/model/order/items/OrderItem.java
src/org/mxchange/jshopcore/model/payment/PaymentType.java [deleted file]
src/org/mxchange/jshopcore/model/product/GenericProduct.java [deleted file]
src/org/mxchange/jshopcore/model/product/Product.java [deleted file]

diff --git a/lib/commons-codec-1.10.jar b/lib/commons-codec-1.10.jar
deleted file mode 100644 (file)
index 1d7417c..0000000
Binary files a/lib/commons-codec-1.10.jar and /dev/null differ
diff --git a/lib/commons-codec/commons-codec-1.10.jar b/lib/commons-codec/commons-codec-1.10.jar
new file mode 100644 (file)
index 0000000..1d7417c
Binary files /dev/null and b/lib/commons-codec/commons-codec-1.10.jar differ
diff --git a/lib/jproduct-core.jar b/lib/jproduct-core.jar
new file mode 100644 (file)
index 0000000..3c8ae07
Binary files /dev/null and b/lib/jproduct-core.jar differ
index 167f5febee1cf41108fe0ee16eedf2a7e60eee66..270f760cf5b253350c0bab59a3dd045595084d26 100644 (file)
@@ -1,3 +1,8 @@
+libs.Commons-Codec_1.10.classpath=\
+    ${base}/commons-codec/commons-codec-1.10.jar
+libs.Commons-Codec_1.10.displayName=Commons-Codec 1.10
+libs.Commons-Codec_1.10.javadoc=\
+    https://commons.apache.org/proper/commons-codec/archives/1.10/apidocs/
 libs.CopyLibs.classpath=\
     ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar
 libs.CopyLibs.displayName=CopyLibs Task
index 35e8bbe885fced7580f79401315a18eb530f934d..2b11f5ebc9cad9667d10a93d46b4a2eafbe71b07 100644 (file)
@@ -30,11 +30,11 @@ dist.jar=${dist.dir}/jshop-core.jar
 dist.javadoc.dir=${dist.dir}/javadoc
 endorsed.classpath=
 excludes=
-file.reference.commons-codec-1.10.jar=lib/commons-codec-1.10.jar
 file.reference.jcontacts-core.jar=lib/jcontacts-core.jar
 file.reference.jcore.jar=lib/jcore.jar
 file.reference.jcoreee.jar=lib/jcoreee.jar
 file.reference.jcustomer-core.jar=lib/jcustomer-core.jar
+file.reference.jproduct-core.jar=lib/jproduct-core.jar
 includes=**
 jar.archive.disabled=${jnlp.enabled}
 jar.compress=false
@@ -44,7 +44,8 @@ javac.classpath=\
     ${file.reference.jcoreee.jar}:\
     ${file.reference.jcontacts-core.jar}:\
     ${file.reference.jcustomer-core.jar}:\
-    ${file.reference.commons-codec-1.10.jar}:\
+    ${file.reference.jproduct-core.jar}:\
+    ${libs.Commons-Codec_1.10.classpath}:\
     ${libs.javaee-api-7.0.classpath}
 # Space-separated list of extra javac options
 javac.compilerargs=-Xlint:unchecked -Xlint:deprecation
@@ -102,5 +103,6 @@ source.reference.jcontacts-core.jar=../jcontacts-core/src/
 source.reference.jcore.jar=../jcore/src/
 source.reference.jcoreee.jar=../jcoreee/src/
 source.reference.jcustomer-core.jar=../jcustomer-core/src/
+source.reference.jproduct-core.jar=../jproduct-core/src/
 src.dir=src
 test.src.dir=test
diff --git a/src/org/mxchange/jshopcore/events/category/AddedCategoryEvent.java b/src/org/mxchange/jshopcore/events/category/AddedCategoryEvent.java
deleted file mode 100644 (file)
index d553cef..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.events.category;
-
-import java.io.Serializable;
-import org.mxchange.jshopcore.model.category.Category;
-
-/**
- * An interface for added category events
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AddedCategoryEvent extends Serializable {
-
-       /**
-        * Getter for added category instance
-        * <p>
-        * @return Added category instance
-        */
-       public Category getAddedCategory ();
-
-}
diff --git a/src/org/mxchange/jshopcore/events/category/ShopCategoryAddedEvent.java b/src/org/mxchange/jshopcore/events/category/ShopCategoryAddedEvent.java
deleted file mode 100644 (file)
index 3f5ba06..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.events.category;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.category.Category;
-
-/**
- * An event fired when a new shop category has been added.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class ShopCategoryAddedEvent implements AddedCategoryEvent {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 83_275_471_765_091_760L;
-
-       /**
-        * Category instance that has been added
-        */
-       private final Category addedCategory;
-
-       /**
-        * Constructor with added category instance
-        * <p>
-        * @param addedCategory Added category
-        */
-       public ShopCategoryAddedEvent (final Category addedCategory) {
-               // The category should be valid
-               if (null == addedCategory) {
-                       // Is NULL, throw NPE
-                       throw new NullPointerException("addedCategory is null"); //NOI18N
-               } else if (addedCategory.getCategoryTitle().isEmpty()) {
-                       // Empty title
-                       throw new IllegalArgumentException("addedCategory.categoryTitle is empty"); //NOI18N
-               } else if (addedCategory.getCategoryId() == null) {
-                       // Id is NULL
-                       throw new NullPointerException("addedCategory.categoryId is null"); //NOI18N
-               } else if (addedCategory.getCategoryId() <= 0) {
-                       // Not valid id
-                       throw new IllegalArgumentException(MessageFormat.format("addedCategory.categoryId={0} is not valid.", addedCategory.getCategoryId())); //NOI18N
-               }
-
-               // Set it here
-               this.addedCategory = addedCategory;
-       }
-
-       @Override
-       public Category getAddedCategory () {
-               return this.addedCategory;
-       }
-
-}
diff --git a/src/org/mxchange/jshopcore/events/product/AddedProductEvent.java b/src/org/mxchange/jshopcore/events/product/AddedProductEvent.java
deleted file mode 100644 (file)
index eb9b51f..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.events.product;
-
-import java.io.Serializable;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * An interface for added product events
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface AddedProductEvent extends Serializable {
-
-       /**
-        * Getter for added product instance
-        * <p>
-        * @return Added product instance
-        */
-       public Product getAddedProduct ();
-
-}
diff --git a/src/org/mxchange/jshopcore/events/product/ShopProductAddedEvent.java b/src/org/mxchange/jshopcore/events/product/ShopProductAddedEvent.java
deleted file mode 100644 (file)
index 68f80e0..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.events.product;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * An event fired when a new shop category has been added.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class ShopProductAddedEvent implements AddedProductEvent {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 18_567_817_669_107L;
-
-       /**
-        * Product instance that has been added
-        */
-       private final Product addedProduct;
-
-       /**
-        * Constructor with added product instance
-        * <p>
-        * @param addedProduct Added product
-        */
-       public ShopProductAddedEvent (final Product addedProduct) {
-               // The category should be valid
-               if (null == addedProduct) {
-                       // Is NULL, throw NPE
-                       throw new NullPointerException("addedProduct is null"); //NOI18N
-               } else if (addedProduct.getProductTitle().isEmpty()) {
-                       // Empty title
-                       throw new IllegalArgumentException("addedProduct.categoryTitle is empty"); //NOI18N
-               } else if (addedProduct.getProductId() == null) {
-                       // Id is NULL
-                       throw new NullPointerException("addedProduct.productId is null"); //NOI18N
-               } else if (addedProduct.getProductId() <= 0) {
-                       // Not valid id
-                       throw new IllegalArgumentException(MessageFormat.format("addedProduct.productId={0} is not valid.", addedProduct.getProductId())); //NOI18N
-               } else if (addedProduct.getProductCategory() == null) {
-                       // Id is NULL
-                       throw new NullPointerException("addedProduct.productCategory is null"); //NOI18N
-               } else if (addedProduct.getProductCategory().getCategoryId() == null) {
-                       // Id is NULL
-                       throw new NullPointerException("addedProduct.productCategory.categoryId is null"); //NOI18N
-               } else if (addedProduct.getProductCategory().getCategoryId() <= 0) {
-                       // Not valid id
-                       throw new IllegalArgumentException(MessageFormat.format("addedProduct.productCategory.categoryId={0} is not valid.", addedProduct.getProductId())); //NOI18N
-               }
-
-               // Set it here
-               this.addedProduct = addedProduct;
-       }
-
-       @Override
-       public Product getAddedProduct () {
-               return this.addedProduct;
-       }
-
-}
diff --git a/src/org/mxchange/jshopcore/exceptions/CannotAddCategoryException.java b/src/org/mxchange/jshopcore/exceptions/CannotAddCategoryException.java
deleted file mode 100644 (file)
index f1b89d7..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.exceptions;
-
-/**
- * An exception thrown when the category cannot be added for a "low level"
- * reason.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CannotAddCategoryException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 34_295_843_957_951L;
-
-       /**
-        * Constructor with cause
-        * <p>
-        * @param cause Causing exception
-        */
-       public CannotAddCategoryException (final Throwable cause) {
-               // Call super constructor
-               super(cause);
-       }
-}
diff --git a/src/org/mxchange/jshopcore/exceptions/CannotAddProductException.java b/src/org/mxchange/jshopcore/exceptions/CannotAddProductException.java
deleted file mode 100644 (file)
index 2bcb67b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.exceptions;
-
-/**
- * An exception thrown when the product cannot be added for a "low level"
- * reason.
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CannotAddProductException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 48_574_857_485_748_175L;
-
-       /**
-        * Constructor with cause
-        * <p>
-        * @param cause Causing exception
-        */
-       public CannotAddProductException (final Throwable cause) {
-               // Call super constructor
-               super(cause);
-       }
-}
diff --git a/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java
deleted file mode 100644 (file)
index 54bb530..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.category.Category;
-
-/**
- * An exception thrown when the given title is already used
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class CategoryTitleAlreadyUsedException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 53_751_434_673_262L;
-
-       /**
-        * Constructor with HttpServletRequest instance
-        * <p>
-        * @param category Category instance
-        */
-       public CategoryTitleAlreadyUsedException (final Category category) {
-               // Call super constructor
-               super(MessageFormat.format("Title {0} is already used.", category.getCategoryTitle())); //NOI18N
-       }
-}
diff --git a/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java
deleted file mode 100644 (file)
index 1c0bef3..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.exceptions;
-
-import java.text.MessageFormat;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * An exception thrown when the given title is already used
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public class ProductTitleAlreadyUsedException extends Exception {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 4_252_734_834_174L;
-
-       /**
-        * Constructor with HttpServletRequest instance
-        * <p>
-        * @param product Product instance
-        */
-       public ProductTitleAlreadyUsedException (final Product product) {
-               // Call super constructor
-               super(MessageFormat.format("Title {0} is already used.", product.getProductTitle())); //NOI18N
-       }
-}
index c7f05564dc34d8aa2d8f36d784491fab6015332e..9ee92c085e78db6b4bf64d43998479da91cb0bec 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jshopcore.model.basket;
 
 import java.io.Serializable;
-import org.mxchange.jshopcore.model.product.Product;
+import org.mxchange.jproduct.model.product.Product;
 
 /**
  * An interface for addable basket items
index 734fd85ca123b941817cd898ccc0b17c7e71999b..269dbc4cfcac2d8212e626420bfde1f7dcebfd2d 100644 (file)
@@ -17,8 +17,8 @@
 package org.mxchange.jshopcore.model.basket.items;
 
 import java.util.Objects;
+import org.mxchange.jproduct.model.product.Product;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.product.Product;
 
 /**
  * An item (addable to a basket) could represent a product or a discount coupon.
index 6915615cb255fb9f0e684642150d01ed0eb48efe..fd00cc95383f1198b44e5f630c0047b8df1a62cc 100644 (file)
@@ -27,9 +27,9 @@ import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Transient;
+import org.mxchange.jproduct.model.product.GenericProduct;
+import org.mxchange.jproduct.model.product.Product;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
-import org.mxchange.jshopcore.model.product.GenericProduct;
-import org.mxchange.jshopcore.model.product.Product;
 
 /**
  * A general basket item
@@ -108,7 +108,7 @@ public class BasketItem extends BaseItem implements AddableBasketItem {
         * Constructor for an item from given Product instance and orderedAmount.
         * <p>
         * @param product Product instance
-        * @param amount Ordered orderedAmount
+        * @param amount  Ordered orderedAmount
         */
        public BasketItem (final Product product, final Long amount) {
                // Other constructor
diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java
deleted file mode 100644 (file)
index 65136b7..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.category;
-
-import java.io.Serializable;
-
-/**
- * An interface for categories
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface Category extends Serializable {
-
-       /**
-        * Copies all properties from other category to this
-        * <p>
-        * @param category Source category instance
-        */
-       void copyAll (final Category category);
-
-       /**
-        * Id number of category
-        * <p>
-        * @return the id
-        */
-       Long getCategoryId ();
-
-       /**
-        * Id number of category
-        * <p>
-        * @param id the id to set
-        */
-       void setCategoryId (final Long id);
-
-       /**
-        * Parent category
-        * <p>
-        * @return the parent category
-        */
-       Category getParentCategory ();
-
-       /**
-        * Parent category
-        * <p>
-        * @param parentCategory the parent category to set
-        */
-       void setParentCategory (final Category parentCategory);
-
-       /**
-        * Title of category
-        * <p>
-        * @return the title
-        */
-       String getCategoryTitle ();
-
-       /**
-        * Title of category
-        * <p>
-        * @param title the title to set
-        */
-       void setCategoryTitle (final String title);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-
-}
diff --git a/src/org/mxchange/jshopcore/model/category/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/ProductCategory.java
deleted file mode 100644 (file)
index 3549757..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-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;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-
-/**
- * A product category
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Entity (name = "category")
-@Table (name = "category")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class ProductCategory implements Category {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 21_458_945_712_659L;
-
-       /**
-        * Id number of category
-        */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "category_id", nullable = false)
-       private Long categoryId;
-
-       /**
-        * Title of category
-        */
-       @Basic (optional = false)
-       @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.REFRESH)
-       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
-        */
-       public ProductCategory (final Long categoryId, final String categoryTitle, final Category parentCategory) {
-               // Set all here
-               this.categoryId = categoryId;
-               this.categoryTitle = categoryTitle;
-               this.parentCategory = parentCategory;
-       }
-
-       /**
-        * Default constructor
-        */
-       public ProductCategory () {
-       }
-
-       @Override
-       public void copyAll (final Category category) {
-               // Copy all data
-               this.setParentCategory(category.getParentCategory());
-               this.setCategoryTitle(category.getCategoryTitle());
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (this == object) {
-                       return true;
-               } else if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Category other = (Category) object;
-
-               if (!Objects.equals(this.getCategoryTitle(), other.getCategoryTitle())) {
-                       return false;
-               } else if (!Objects.equals(this.getCategoryId(), other.getCategoryId())) {
-                       return false;
-               }
-
-               return true;
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 7;
-               hash = 13 * hash + Objects.hashCode(this.getCategoryId());
-               hash = 13 * hash + Objects.hashCode(this.getCategoryTitle());
-               return hash;
-       }
-
-       @Override
-       public Long getCategoryId () {
-               return this.categoryId;
-       }
-
-       @Override
-       public void setCategoryId (final Long categoryId) {
-               this.categoryId = categoryId;
-       }
-
-       @Override
-       public String getCategoryTitle () {
-               return this.categoryTitle;
-       }
-
-       @Override
-       public void setCategoryTitle (final String categoryTitle) {
-               this.categoryTitle = categoryTitle;
-       }
-
-       @Override
-       public Category getParentCategory () {
-               return this.parentCategory;
-       }
-
-       @Override
-       public void setParentCategory (final Category parentCategory) {
-               this.parentCategory = parentCategory;
-       }
-
-}
index 4e79768cfdf06ba5ccf0e825269f32ca86a9577b..e1d24e1790ca40a609b120cf2c71a4e4d946c22f 100644 (file)
@@ -29,10 +29,10 @@ import javax.persistence.JoinColumn;
 import javax.persistence.OneToOne;
 import javax.persistence.Table;
 import javax.persistence.Transient;
+import org.mxchange.jproduct.model.product.GenericProduct;
+import org.mxchange.jproduct.model.product.Product;
 import org.mxchange.jshopcore.model.basket.AddableBasketItem;
 import org.mxchange.jshopcore.model.basket.items.BaseItem;
-import org.mxchange.jshopcore.model.product.GenericProduct;
-import org.mxchange.jshopcore.model.product.Product;
 
 /**
  * A general basket item
diff --git a/src/org/mxchange/jshopcore/model/payment/PaymentType.java b/src/org/mxchange/jshopcore/model/payment/PaymentType.java
deleted file mode 100644 (file)
index 55c46bd..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Copyright (C) 2017 Roland Haeder<roland@mxchange.org>
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.payment;
-
-/**
- * Payment types
- * <p>
- * @author Roland Haeder<roland@mxchange.org>
- */
-public enum PaymentType {
-
-       /**
-        * Payment type "cash"
-        */
-       PAYMENT_TYPE_CASH,
-       /**
-        * Payment type "credit card"
-        */
-       PAYMENT_TYPE_CREDIT_CARD,
-       /**
-        * Payment type "prepayment"
-        */
-       PAYMENT_TYPE_PREPAYMENT,
-       /**
-        * Payment type "invoice"
-        */
-       PAYMENT_TYPE_INVOICE;
-
-}
diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java
deleted file mode 100644 (file)
index febde61..0000000
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.product;
-
-import java.util.Objects;
-import javax.persistence.Basic;
-import javax.persistence.CascadeType;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.JoinColumn;
-import javax.persistence.OneToOne;
-import javax.persistence.Table;
-import javax.persistence.Transient;
-import org.mxchange.jshopcore.model.category.Category;
-import org.mxchange.jshopcore.model.category.ProductCategory;
-
-/**
- * Generic product class
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- * TODO: Find a better name
- */
-@Entity (name = "products")
-@Table (name = "products")
-@SuppressWarnings ("PersistenceUnitPresent")
-public class GenericProduct implements Product {
-
-       /**
-        * Serial number
-        */
-       @Transient
-       private static final long serialVersionUID = 54_578_571_769_283L;
-
-       /**
-        * Availability of product
-        */
-       @Column (name = "product_availability", nullable = false)
-       private Boolean productAvailability;
-
-       /**
-        * Product productCategory
-        */
-       @JoinColumn (name = "category_id", nullable = false, updatable = false)
-       @OneToOne (targetEntity = ProductCategory.class, cascade = CascadeType.REFRESH, optional = false)
-       private Category productCategory;
-
-       /**
-        * Id number of product
-        */
-       @Id
-       @GeneratedValue (strategy = GenerationType.IDENTITY)
-       @Column (name = "product_id", nullable = false, updatable = false)
-       private Long productId;
-
-       /**
-        * Price of product
-        */
-       @Basic (optional = false)
-       @Column (name = "product_price", nullable = false)
-       private Float productPrice;
-
-       /**
-        * Title of product
-        */
-       @Basic (optional = false)
-       @Column (name = "product_title", length = 100, nullable = false)
-       private String productTitle;
-
-       /**
-        * Default constructor
-        */
-       public GenericProduct () {
-       }
-
-       /**
-        * Constructor will all required data
-        * <p>
-        * @param productId           Id number of product
-        * @param productTitle        Name of product
-        * @param productPrice        Price
-        * @param productCategory     Category instance
-        * @param productAvailability Availability (selectable by customer)
-        */
-       public GenericProduct (final Long productId, final String productTitle, final Float productPrice, final Category productCategory, final Boolean productAvailability) {
-               // Set all here
-               this.productId = productId;
-               this.productTitle = productTitle;
-               this.productPrice = productPrice;
-               this.productCategory = productCategory;
-               this.productAvailability = productAvailability;
-       }
-
-       @Override
-       public void copyAll (final Product product) {
-               // Copy all
-               this.setProductAvailability(product.getProductAvailability());
-               this.setProductCategory(product.getProductCategory());
-               this.setProductPrice(product.getProductPrice());
-               this.setProductTitle(product.getProductTitle());
-       }
-
-       @Override
-       public boolean equals (final Object object) {
-               if (this == object) {
-                       return true;
-               } else if (null == object) {
-                       return false;
-               } else if (this.getClass() != object.getClass()) {
-                       return false;
-               }
-
-               final Product other = (Product) object;
-
-               if (!Objects.equals(this.getProductTitle(), other.getProductTitle())) {
-                       return false;
-               }
-
-               return Objects.equals(this.getProductId(), other.getProductId());
-       }
-
-       @Override
-       public int hashCode () {
-               int hash = 7;
-               hash = 23 * hash + Objects.hashCode(this.getProductId());
-               hash = 23 * hash + Objects.hashCode(this.getProductTitle());
-               return hash;
-       }
-
-       @Override
-       public Boolean getProductAvailability () {
-               return this.productAvailability;
-       }
-
-       @Override
-       public void setProductAvailability (final Boolean productAvailability) {
-               this.productAvailability = productAvailability;
-       }
-
-       @Override
-       public Category getProductCategory () {
-               return this.productCategory;
-       }
-
-       @Override
-       public void setProductCategory (final Category productCategory) {
-               this.productCategory = productCategory;
-       }
-
-       @Override
-       public Long getProductId () {
-               return this.productId;
-       }
-
-       @Override
-       public void setProductId (final Long productId) {
-               this.productId = productId;
-       }
-
-       @Override
-       public Float getProductPrice () {
-               return this.productPrice;
-       }
-
-       @Override
-       public void setProductPrice (final Float productPrice) {
-               this.productPrice = productPrice;
-       }
-
-       @Override
-       public String getProductTitle () {
-               return this.productTitle;
-       }
-
-       @Override
-       public void setProductTitle (final String productTitle) {
-               this.productTitle = productTitle;
-       }
-
-}
diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java
deleted file mode 100644 (file)
index 0347f33..0000000
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (C) 2016 Roland Häder
- *
- * 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
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-package org.mxchange.jshopcore.model.product;
-
-import java.io.Serializable;
-import org.mxchange.jshopcore.model.category.Category;
-
-/**
- * An interface for in database storable products
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-public interface Product extends Serializable {
-
-       /**
-        * Copies all properties from source product to this.
-        * <p>
-        * @param product Source product
-        */
-       void copyAll (final Product product);
-
-       /**
-        * Getter for product availability
-        * <p>
-        * @return Product availability
-        */
-       Boolean getProductAvailability ();
-
-       /**
-        * Setter for product availability
-        * <p>
-        * @param productAvailability Product availability
-        */
-       void setProductAvailability (final Boolean productAvailability);
-
-       /**
-        * Getter for product category id
-        * <p>
-        * @return Product category id
-        */
-       Category getProductCategory ();
-
-       /**
-        * Setter for product category
-        * <p>
-        * @param productCategory Product category
-        */
-       void setProductCategory (final Category productCategory);
-
-       /**
-        * Getter for id number, suitable for form fields.
-        * <p>
-        * @return Id number of product
-        */
-       Long getProductId ();
-
-       /**
-        * Id number of product
-        * <p>
-        * @param productId the id number to set
-        */
-       void setProductId (final Long productId);
-
-       /**
-        * Getter for raw price.
-        * <p>
-        * @return Single price of product
-        */
-       Float getProductPrice ();
-
-       /**
-        * Price of product
-        * <p>
-        * @param productPrice the price to set
-        */
-       void setProductPrice (final Float productPrice);
-
-       /**
-        * Getter for title.
-        * <p>
-        * @return Title of product
-        */
-       String getProductTitle ();
-
-       /**
-        * Title of product
-        * <p>
-        * @param productTitle the title to set
-        */
-       void setProductTitle (final String productTitle);
-
-       @Override
-       boolean equals (final Object object);
-
-       @Override
-       int hashCode ();
-
-}