From: Roland Haeder <roland@mxchange.org>
Date: Mon, 7 Sep 2015 18:47:39 +0000 (+0200)
Subject: Continued:
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=6b9f17d0a9ac8377e24651fb9f48e2d3ce7de94e;p=jshop-core.git

Continued:
- updated jcore.jar
- got rid of some things that don't work in EJB container ... :-(
Signed-off-by:Roland Häder <roland@mxchange.org>
---

diff --git a/lib/jcore.jar b/lib/jcore.jar
index 636db5c..1e4a78b 100644
Binary files a/lib/jcore.jar and b/lib/jcore.jar differ
diff --git a/src/org/mxchange/jshopcore/BaseShopCore.java b/src/org/mxchange/jshopcore/BaseShopCore.java
deleted file mode 100644
index fe407a6..0000000
--- a/src/org/mxchange/jshopcore/BaseShopCore.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (C) 2015 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
- * 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;
-
-import org.mxchange.jcore.BaseFrameworkSystem;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * A general shop class
- *
- * @author Roland Haeder
- */
-public class BaseShopCore extends BaseFrameworkSystem implements ShopInterface {
-	/**
-	 * Item instance
-	 */
-	private Product product;
-
-	/**
-	 * @return the product
-	 */
-	@Override
-	public Product getProduct () {
-		return this.product;
-	}
-
-	/**
-	 * @param product the product to set
-	 */
-	@Override
-	public void setProduct (final Product product) {
-		this.product = product;
-	}
-}
diff --git a/src/org/mxchange/jshopcore/ShopInterface.java b/src/org/mxchange/jshopcore/ShopInterface.java
deleted file mode 100644
index d2813e5..0000000
--- a/src/org/mxchange/jshopcore/ShopInterface.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Copyright (C) 2015 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
- * 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;
-
-import org.mxchange.jcore.FrameworkInterface;
-import org.mxchange.jshopcore.model.product.Product;
-
-/**
- * A general shop interface
- *
- * @author Roland Haeder
- */
-public interface ShopInterface extends FrameworkInterface {
-	/**
-	 * @return the product
-	 */
-	public Product getProduct ();
-
-	/**
-	 * @param product the product to set
-	 */
-	public void setProduct (final Product product);
-}
diff --git a/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java
index ae81b3c..4936d65 100644
--- a/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java
+++ b/src/org/mxchange/jshopcore/exceptions/CategoryTitleAlreadyUsedException.java
@@ -28,7 +28,7 @@ public class CategoryTitleAlreadyUsedException extends Exception {
 	/**
 	 * Serial number
 	 */
-	private static final long serialVersionUID = 53751434673262L;
+	private static final long serialVersionUID = 53_751_434_673_262L;
 
 	/**
 	 * Constructor with HttpServletRequest instance
diff --git a/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java b/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java
index 1206661..3191646 100644
--- a/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java
+++ b/src/org/mxchange/jshopcore/exceptions/ProductTitleAlreadyUsedException.java
@@ -28,7 +28,7 @@ public class ProductTitleAlreadyUsedException extends Exception {
 	/**
 	 * Serial number
 	 */
-	private static final long serialVersionUID = 4252734834174L;
+	private static final long serialVersionUID = 4_252_734_834_174L;
 
 	/**
 	 * Constructor with HttpServletRequest instance
diff --git a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java
index 9c2b1ae..b019f83 100644
--- a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java
+++ b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java
@@ -22,7 +22,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.text.MessageFormat;
 import java.util.Map;
-import org.mxchange.jshopcore.BaseShopCore;
+import org.mxchange.jcore.BaseFrameworkSystem;
 import org.mxchange.jshopcore.model.item.AddableBasketItem;
 
 /**
@@ -31,11 +31,11 @@ import org.mxchange.jshopcore.model.item.AddableBasketItem;
  * @author Roland Haeder
  * @param <T> Any instance that implements AddableBasketItem
  */
-public class BaseBasket<T extends AddableBasketItem> extends BaseShopCore implements Basket<T>, Serializable {
+public abstract class BaseBasket<T extends AddableBasketItem> extends BaseFrameworkSystem implements Basket<T>, Serializable {
 	/**
 	 * Serial number
 	 */
-	private static final long serialVersionUID = 784396762230845717L;
+	private static final long serialVersionUID = 784_396_762_230_845_717L;
 
 	/**
 	 * Protected constructor with session instance
@@ -53,7 +53,7 @@ public class BaseBasket<T extends AddableBasketItem> extends BaseShopCore implem
 		this.getLogger().trace("CALLED!"); //NOI18N
 
 		// Is the bundle initialized?
-		if (!BaseShopCore.isBundledInitialized()) {
+		if (!BaseFrameworkSystem.isBundledInitialized()) {
 			// Temporary initialize default bundle
 			// TODO The enum Gender uses this
 			this.initBundle();
diff --git a/src/org/mxchange/jshopcore/model/basket/Basket.java b/src/org/mxchange/jshopcore/model/basket/Basket.java
index 97423d7..46af288 100644
--- a/src/org/mxchange/jshopcore/model/basket/Basket.java
+++ b/src/org/mxchange/jshopcore/model/basket/Basket.java
@@ -21,7 +21,7 @@ import java.io.Serializable;
 import java.lang.reflect.InvocationTargetException;
 import java.sql.SQLException;
 import java.util.Map;
-import org.mxchange.jshopcore.ShopInterface;
+import org.mxchange.jcore.FrameworkInterface;
 import org.mxchange.jshopcore.model.item.AddableBasketItem;
 
 /**
@@ -30,7 +30,7 @@ import org.mxchange.jshopcore.model.item.AddableBasketItem;
  * @author Roland Haeder
  * @param <T> Any addable basket items
  */
-public interface Basket<T extends AddableBasketItem> extends Serializable, ShopInterface {
+public interface Basket<T extends AddableBasketItem> extends FrameworkInterface, Serializable {
 
 	/**
 	 * Adds given item instance to this basket
diff --git a/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java b/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java
index b7dda1f..9cd3c53 100644
--- a/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java
+++ b/src/org/mxchange/jshopcore/model/basket/item/ItemBasket.java
@@ -30,7 +30,7 @@ public class ItemBasket extends BaseBasket<AddableBasketItem> implements Basket<
 	/**
 	 * Serial number
 	 */
-	private static final long serialVersionUID = 4384123923163957L;
+	private static final long serialVersionUID = 4_384_123_923_163_957L;
 
 	/**
 	 * Default constructor to be able to throw exceptions from super constructor
diff --git a/src/org/mxchange/jshopcore/model/category/BaseCategory.java b/src/org/mxchange/jshopcore/model/category/BaseCategory.java
index 493da9b..5588dbe 100644
--- a/src/org/mxchange/jshopcore/model/category/BaseCategory.java
+++ b/src/org/mxchange/jshopcore/model/category/BaseCategory.java
@@ -19,14 +19,14 @@ package org.mxchange.jshopcore.model.category;
 import java.io.UnsupportedEncodingException;
 import java.text.MessageFormat;
 import java.util.Objects;
-import org.mxchange.jshopcore.BaseShopCore;
+import org.mxchange.jcore.BaseFrameworkSystem;
 
 /**
  * A general product category class
  *
  * @author Roland Haeder
  */
-public class BaseCategory extends BaseShopCore implements Category {
+public abstract class BaseCategory extends BaseFrameworkSystem implements Category {
 
 	/**
 	 * Id number of category
@@ -52,9 +52,9 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 */
 	protected BaseCategory (final Long categoryId, final String title, final Long parentId) {
 		// Set all here
-		this.setCategoryId(categoryId);
-		this.setTitle(title);
-		this.setParentId(parentId);
+		this.categoryId = categoryId;
+		this.title = title;
+		this.parentId = parentId;
 	}
 
 	/**
@@ -101,7 +101,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @return Decoded title
 	 */
 	@Override
-	public final String getDecodedTitle () throws UnsupportedEncodingException {
+	public String getDecodedTitle () throws UnsupportedEncodingException {
 		// Get title
 		byte[] t = this.getTitle().getBytes();
 
@@ -115,7 +115,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @return the categoryId
 	 */
 	@Override
-	public final Long getCategoryId () {
+	public Long getCategoryId () {
 		return this.categoryId;
 	}
 
@@ -125,7 +125,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @param categoryId the categoryId to set
 	 */
 	@Override
-	public final void setCategoryId (final Long categoryId) {
+	public void setCategoryId (final Long categoryId) {
 		this.categoryId = categoryId;
 	}
 
@@ -135,7 +135,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @return the parentId
 	 */
 	@Override
-	public final Long getParentId () {
+	public Long getParentId () {
 		return this.parentId;
 	}
 
@@ -145,7 +145,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @param parentId the parentId to set
 	 */
 	@Override
-	public final void setParentId (final Long parentId) {
+	public void setParentId (final Long parentId) {
 		this.parentId = parentId;
 	}
 
@@ -155,7 +155,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @return the title
 	 */
 	@Override
-	public final String getTitle () {
+	public String getTitle () {
 		return this.title;
 	}
 
@@ -165,7 +165,7 @@ public class BaseCategory extends BaseShopCore implements Category {
 	 * @param title the title to set
 	 */
 	@Override
-	public final void setTitle (final String title) {
+	public void setTitle (final String title) {
 		this.title = title;
 	}
 }
diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java
index a32f8bd..4edbdee 100644
--- a/src/org/mxchange/jshopcore/model/category/Category.java
+++ b/src/org/mxchange/jshopcore/model/category/Category.java
@@ -17,14 +17,14 @@
 package org.mxchange.jshopcore.model.category;
 
 import java.io.UnsupportedEncodingException;
-import org.mxchange.jshopcore.ShopInterface;
+import org.mxchange.jcore.FrameworkInterface;
 
 /**
  * An interface for categories
  *
  * @author Roland Haeder
  */
-public interface Category extends ShopInterface, Comparable<Category> {
+public interface Category extends FrameworkInterface, Comparable<Category> {
 
 	/**
 	 * Id number of category
diff --git a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java b/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java
index 8ca2c40..fd75a98 100644
--- a/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java
+++ b/src/org/mxchange/jshopcore/model/item/AddableBasketItem.java
@@ -16,14 +16,15 @@
  */
 package org.mxchange.jshopcore.model.item;
 
-import org.mxchange.jshopcore.ShopInterface;
+import org.mxchange.jcore.FrameworkInterface;
+import org.mxchange.jshopcore.model.product.Product;
 
 /**
  * An interface for addable basket items
  *
  * @author Roland Haeder
  */
-public interface AddableBasketItem extends ShopInterface, Comparable<AddableBasketItem> {
+public interface AddableBasketItem extends FrameworkInterface, Comparable<AddableBasketItem> {
 
 	/**
 	 * Item amount
@@ -76,6 +77,16 @@ public interface AddableBasketItem extends ShopInterface, Comparable<AddableBask
 	 */
 	public Float calculateTotalPrice ();
 
+	/**
+	 * @return the product
+	 */
+	public Product getProduct ();
+
+	/**
+	 * @param product the product to set
+	 */
+	public void setProduct (final Product product);
+
 	/**
 	 * Compare method
 	 * @param item Item to compare to
diff --git a/src/org/mxchange/jshopcore/model/item/BaseItem.java b/src/org/mxchange/jshopcore/model/item/BaseItem.java
index 25c758d..213ac7f 100644
--- a/src/org/mxchange/jshopcore/model/item/BaseItem.java
+++ b/src/org/mxchange/jshopcore/model/item/BaseItem.java
@@ -18,7 +18,8 @@ package org.mxchange.jshopcore.model.item;
 
 import java.text.MessageFormat;
 import java.util.Objects;
-import org.mxchange.jshopcore.BaseShopCore;
+import org.mxchange.jcore.BaseFrameworkSystem;
+import org.mxchange.jshopcore.model.product.Product;
 
 /**
  * An item (addedable to a basket) could respresent a product or a discount
@@ -26,7 +27,7 @@ import org.mxchange.jshopcore.BaseShopCore;
  *
  * @author Roland Haeder
  */
-public class BaseItem extends BaseShopCore implements AddableBasketItem {
+public abstract class BaseItem extends BaseFrameworkSystem implements AddableBasketItem {
 	/**
 	 * Entry id (from database backend)
 	 */
@@ -47,6 +48,11 @@ public class BaseItem extends BaseShopCore implements AddableBasketItem {
 	 */
 	private String itemType;
 
+	/**
+	 * Item instance
+	 */
+	private Product product;
+
 	@Override
 	public Float calculateTotalPrice () {
 		// product should be set
@@ -87,42 +93,58 @@ public class BaseItem extends BaseShopCore implements AddableBasketItem {
 	}
 
 	@Override
-	public final Long getAmount () {
+	public Long getAmount () {
 		return this.amount;
 	}
 
 	@Override
-	public final void setAmount (final Long amount) {
+	public void setAmount (final Long amount) {
 		this.amount = amount;
 	}
 
 	@Override
-	public final Long getId () {
+	public Long getId () {
 		return this.id;
 	}
 
 	@Override
-	public final void setId (final Long id) {
+	public void setId (final Long id) {
 		this.id = id;
 	}
 
 	@Override
-	public final Long getItemId () {
+	public Long getItemId () {
 		return this.itemId;
 	}
 
 	@Override
-	public final void setItemId( final Long itemId) {
+	public void setItemId( final Long itemId) {
 		this.itemId = itemId;
 	}
 
 	@Override
-	public final String getItemType () {
+	public String getItemType () {
 		return this.itemType;
 	}
 
 	@Override
-	public final void setItemType (final String itemType) {
+	public void setItemType (final String itemType) {
 		this.itemType = itemType;
 	}
+
+	/**
+	 * @return the product
+	 */
+	@Override
+	public Product getProduct () {
+		return this.product;
+	}
+
+	/**
+	 * @param product the product to set
+	 */
+	@Override
+	public void setProduct (final Product product) {
+		this.product = product;
+	}
 }
diff --git a/src/org/mxchange/jshopcore/model/product/BaseProduct.java b/src/org/mxchange/jshopcore/model/product/BaseProduct.java
index 5faa9bf..e1cc402 100644
--- a/src/org/mxchange/jshopcore/model/product/BaseProduct.java
+++ b/src/org/mxchange/jshopcore/model/product/BaseProduct.java
@@ -7,13 +7,13 @@ package org.mxchange.jshopcore.model.product;
 
 import java.text.MessageFormat;
 import java.util.Objects;
-import org.mxchange.jshopcore.BaseShopCore;
+import org.mxchange.jcore.BaseFrameworkSystem;
 
 /**
  *
  * @author Roland Haeder
  */
-public class BaseProduct extends BaseShopCore implements Product {
+public abstract class BaseProduct extends BaseFrameworkSystem implements Product {
 	/**
 	 * Availability of product
 	 */
@@ -66,52 +66,52 @@ public class BaseProduct extends BaseShopCore implements Product {
 	}
 
 	@Override
-	public final Boolean getAvailable () {
+	public Boolean getAvailable () {
 		return this.available;
 	}
 
 	@Override
-	public final void setAvailable (final Boolean available) {
+	public void setAvailable (final Boolean available) {
 		this.available = available;
 	}
 
 	@Override
-	public final Long getCategoryId () {
+	public Long getCategoryId () {
 		return this.categoryId;
 	}
 
 	@Override
-	public final void setCategoryId (final Long categoryId) {
+	public void setCategoryId (final Long categoryId) {
 		this.categoryId = categoryId;
 	}
 
 	@Override
-	public final Long getItemId () {
+	public Long getItemId () {
 		return this.itemId;
 	}
 
 	@Override
-	public final void setItemId (final Long itemId) {
+	public void setItemId (final Long itemId) {
 		this.itemId = itemId;
 	}
 
 	@Override
-	public final Float getPrice () {
+	public Float getPrice () {
 		return this.price;
 	}
 
 	@Override
-	public final void setPrice (final Float price) {
+	public void setPrice (final Float price) {
 		this.price = price;
 	}
 
 	@Override
-	public final String getTitle () {
+	public String getTitle () {
 		return this.title;
 	}
 
 	@Override
-	public final void setTitle (final String title) {
+	public void setTitle (final String title) {
 		this.title = title;
 	}
 }
diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java
index d0e46fb..b70a199 100644
--- a/src/org/mxchange/jshopcore/model/product/Product.java
+++ b/src/org/mxchange/jshopcore/model/product/Product.java
@@ -16,14 +16,14 @@
  */
 package org.mxchange.jshopcore.model.product;
 
-import org.mxchange.jshopcore.ShopInterface;
+import org.mxchange.jcore.FrameworkInterface;
 
 /**
  * An interface for in database storable products
  *
  * @author Roland Haeder
  */
-public interface Product extends ShopInterface, Comparable<Product> {
+public interface Product extends FrameworkInterface, Comparable<Product> {
 	/**
 	 * Getter for id number, suitable for form fields.
 	 * 
diff --git a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java
index 7fe9de6..1b5b863 100644
--- a/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java
+++ b/src/org/mxchange/jshopcore/model/product/generic/GenericProduct.java
@@ -24,6 +24,7 @@ import org.mxchange.jshopcore.model.product.Product;
  * Generic product class
  *
  * @author Roland Haeder
+ * TODO: Find a better name
  */
 public class GenericProduct extends BaseProduct implements Product {
 	/**