From: Roland Haeder Date: Wed, 9 Sep 2015 20:11:03 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=825dad8dce51f55184373feda45a6b64896390cd;p=jcustomer-core.git Continued: - updated jcore.jar + jcore-ee-logger.jar, jcoreee.jar - added Java EE API 7.0 - maybe it works this way? :-( Signed-off-by:Roland Häder --- diff --git a/lib/javaee-api-7.0/javaee-api-7.0.jar b/lib/javaee-api-7.0/javaee-api-7.0.jar new file mode 100644 index 0000000..09de736 Binary files /dev/null and b/lib/javaee-api-7.0/javaee-api-7.0.jar differ diff --git a/lib/javaee-api-7.0/javaee-doc-api.jar b/lib/javaee-api-7.0/javaee-doc-api.jar new file mode 100644 index 0000000..bdebe91 Binary files /dev/null and b/lib/javaee-api-7.0/javaee-doc-api.jar differ diff --git a/lib/jcore-ee-logger.jar b/lib/jcore-ee-logger.jar index 2fd4452..0b6d194 100644 Binary files a/lib/jcore-ee-logger.jar and b/lib/jcore-ee-logger.jar differ diff --git a/lib/jcore.jar b/lib/jcore.jar index ea3515c..54ec8aa 100644 Binary files a/lib/jcore.jar and b/lib/jcore.jar differ diff --git a/lib/jcoreee.jar b/lib/jcoreee.jar index 543a51b..e78b86d 100644 Binary files a/lib/jcoreee.jar and b/lib/jcoreee.jar differ diff --git a/lib/nblibraries.properties b/lib/nblibraries.properties index 6d0afb5..1f1df42 100644 --- a/lib/nblibraries.properties +++ b/lib/nblibraries.properties @@ -2,3 +2,9 @@ libs.CopyLibs.classpath=\ ${base}/CopyLibs/org-netbeans-modules-java-j2seproject-copylibstask.jar libs.CopyLibs.displayName=CopyLibs Task libs.CopyLibs.prop-version=2.0 +libs.javaee-api-7.0.classpath=\ + ${base}/javaee-api-7.0/javaee-api-7.0.jar +libs.javaee-api-7.0.displayName=Java EE 7 API Library +libs.javaee-api-7.0.javadoc=\ + ${base}/javaee-api-7.0/javaee-doc-api.jar +libs.javaee-api-7.0.prop-maven-dependencies=javax:javaee-api:7.0:jar diff --git a/nbproject/project.properties b/nbproject/project.properties index 7d9b5fe..feebabc 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -39,7 +39,8 @@ jar.index=${jnlp.enabled} javac.classpath=\ ${file.reference.jcore.jar}:\ ${reference.jcore-ee-logger.dist}:\ - ${file.reference.jcoreee.jar} + ${file.reference.jcoreee.jar}:\ + ${libs.javaee-api-7.0.classpath} # Space-separated list of extra javac options javac.compilerargs=-Xlint:unchecked -Xlint:deprecation javac.deprecation=true diff --git a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java index f3afbf7..1110c43 100644 --- a/src/org/mxchange/jshopcore/model/basket/BaseBasket.java +++ b/src/org/mxchange/jshopcore/model/basket/BaseBasket.java @@ -18,7 +18,9 @@ package org.mxchange.jshopcore.model.basket; import java.text.MessageFormat; import java.util.Map; -import org.mxchange.jcoreee.BaseEeSystem; +import javax.ejb.EJB; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; /** * A general basket class @@ -26,12 +28,19 @@ import org.mxchange.jcoreee.BaseEeSystem; * @author Roland Haeder * @param Any instance that implements AddableBasketItem */ -public abstract class BaseBasket extends BaseEeSystem implements Basket { +public abstract class BaseBasket implements Basket { /** * Serial number */ private static final long serialVersionUID = 782_396_762_230_845_717L; + /** + * Logger instance + */ + @EJB + @Log + private LoggerBeanLocal logger; + /** * Protected constructor with session instance */ @@ -127,4 +136,13 @@ public abstract class BaseBasket extends BaseEeSyst // Return it return isAdded; } + + /** + * Getter for logger + * + * @return Logger instance + */ + private LoggerBeanLocal getLogger () { + return this.logger; + } } diff --git a/src/org/mxchange/jshopcore/model/category/BaseCategory.java b/src/org/mxchange/jshopcore/model/category/BaseCategory.java index ecc6a82..3ddcd4f 100644 --- a/src/org/mxchange/jshopcore/model/category/BaseCategory.java +++ b/src/org/mxchange/jshopcore/model/category/BaseCategory.java @@ -18,14 +18,16 @@ package org.mxchange.jshopcore.model.category; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoreee.BaseEeSystem; +import javax.ejb.EJB; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; /** * A general product category class * * @author Roland Haeder */ -public abstract class BaseCategory extends BaseEeSystem implements Category { +public abstract class BaseCategory implements Category, Comparable { /** * Serial number */ @@ -46,6 +48,13 @@ public abstract class BaseCategory extends BaseEeSystem implements Category { */ private String title; + /** + * Logger instance + */ + @EJB + @Log + private LoggerBeanLocal logger; + /** * Constructor which accepts all database fields * @@ -157,4 +166,13 @@ public abstract class BaseCategory extends BaseEeSystem implements Category { public void setTitle (final String title) { this.title = title; } + + /** + * Getter for logger + * + * @return Logger instance + */ + private LoggerBeanLocal getLogger () { + return this.logger; + } } diff --git a/src/org/mxchange/jshopcore/model/category/Category.java b/src/org/mxchange/jshopcore/model/category/Category.java index 1fb60e8..d0432fd 100644 --- a/src/org/mxchange/jshopcore/model/category/Category.java +++ b/src/org/mxchange/jshopcore/model/category/Category.java @@ -23,7 +23,7 @@ import java.io.Serializable; * * @author Roland Haeder */ -public interface Category extends Comparable, Serializable { +public interface Category extends Serializable { /** * Id number of category @@ -60,12 +60,4 @@ public interface Category extends Comparable, Serializable { * @param title the title to set */ public void setTitle (final String title); - - /** - * Compare method - * @param category Category to compare to - * @return Comparison value - */ - @Override - public int compareTo (final Category category); } diff --git a/src/org/mxchange/jshopcore/model/category/ProductCategory.java b/src/org/mxchange/jshopcore/model/category/ProductCategory.java index cfd56f8..9bd2a61 100644 --- a/src/org/mxchange/jshopcore/model/category/ProductCategory.java +++ b/src/org/mxchange/jshopcore/model/category/ProductCategory.java @@ -16,9 +16,6 @@ */ package org.mxchange.jshopcore.model.category; -import org.mxchange.jshopcore.model.category.BaseCategory; -import org.mxchange.jshopcore.model.category.BaseCategory; - /** * A product category * @author Roland Haeder @@ -31,6 +28,7 @@ public class ProductCategory extends BaseCategory { /** * Constructor which accepts all database fields + * * @param id Id number of database record * @param title Category title * @param parent Parent id diff --git a/src/org/mxchange/jshopcore/model/item/BaseItem.java b/src/org/mxchange/jshopcore/model/item/BaseItem.java index d2895c6..e539d5a 100644 --- a/src/org/mxchange/jshopcore/model/item/BaseItem.java +++ b/src/org/mxchange/jshopcore/model/item/BaseItem.java @@ -18,7 +18,9 @@ package org.mxchange.jshopcore.model.item; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoreee.BaseEeSystem; +import javax.ejb.EJB; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; import org.mxchange.jshopcore.model.basket.AddableBasketItem; import org.mxchange.jshopcore.model.product.Product; @@ -28,7 +30,7 @@ import org.mxchange.jshopcore.model.product.Product; * * @author Roland Haeder */ -public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem, Comparable { +public abstract class BaseItem implements AddableBasketItem, Comparable { /** * Serial number */ @@ -59,6 +61,13 @@ public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem */ private Product product; + /** + * Logger instance + */ + @EJB + @Log + private LoggerBeanLocal logger; + @Override public int compareTo (final AddableBasketItem item) { // Trace message @@ -134,4 +143,13 @@ public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem public void setProduct (final Product product) { this.product = product; } + + /** + * Getter for logger + * + * @return Logger instance + */ + protected LoggerBeanLocal getLogger () { + return this.logger; + } } diff --git a/src/org/mxchange/jshopcore/model/item/BasketItem.java b/src/org/mxchange/jshopcore/model/item/BasketItem.java index 334179e..f4e764b 100644 --- a/src/org/mxchange/jshopcore/model/item/BasketItem.java +++ b/src/org/mxchange/jshopcore/model/item/BasketItem.java @@ -56,7 +56,10 @@ public class BasketItem extends BaseItem implements AddableBasketItem { } // Copy all neccessary values - this.setItemId(product.getItemId()); + this.setItemId(product.getId()); this.setItemType("Product"); //NOI18N + + // Copy instance + this.setProduct(product); } } diff --git a/src/org/mxchange/jshopcore/model/product/BaseProduct.java b/src/org/mxchange/jshopcore/model/product/BaseProduct.java index e655ed5..802a8ec 100644 --- a/src/org/mxchange/jshopcore/model/product/BaseProduct.java +++ b/src/org/mxchange/jshopcore/model/product/BaseProduct.java @@ -7,14 +7,16 @@ package org.mxchange.jshopcore.model.product; import java.text.MessageFormat; import java.util.Objects; -import org.mxchange.jcoreee.BaseEeSystem; +import javax.ejb.EJB; +import org.mxchange.jcoreeelogger.beans.local.logger.Log; +import org.mxchange.jcoreeelogger.beans.local.logger.LoggerBeanLocal; /** * A general product class * * @author Roland Haeder */ -public abstract class BaseProduct extends BaseEeSystem implements Product, Comparable { +public abstract class BaseProduct implements Product, Comparable { /** * Serial number */ @@ -31,9 +33,9 @@ public abstract class BaseProduct extends BaseEeSystem implements Product, Compa private Long categoryId; /** - * Id number of product item + * Id number of product */ - private Long itemId; + private Long id; /** * Price of product @@ -45,6 +47,13 @@ public abstract class BaseProduct extends BaseEeSystem implements Product, Compa */ private String title; + /** + * Logger instance + */ + @EJB + @Log + private LoggerBeanLocal logger; + @Override public int compareTo (final Product product) { // Trace message @@ -56,13 +65,13 @@ public abstract class BaseProduct extends BaseEeSystem implements Product, Compa } // Debug message - this.getLogger().logDebug(MessageFormat.format("this.id={0},product.id={1}", this.getItemId(), product.getItemId())); //NOI18N + this.getLogger().logDebug(MessageFormat.format("this.id={0},product.id={1}", this.getId(), product.getId())); //NOI18N // Is the id the same? - if (Objects.equals(this.getItemId(), product.getItemId())) { + if (Objects.equals(this.getId(), product.getId())) { // Same id, means same category return 0; - } else if (this.getItemId() > product.getItemId()) { + } else if (this.getId() > product.getId()) { // This id is larger than compared to return 1; } @@ -92,13 +101,13 @@ public abstract class BaseProduct extends BaseEeSystem implements Product, Compa } @Override - public Long getItemId () { - return this.itemId; + public Long getId () { + return this.id; } @Override - public void setItemId (final Long itemId) { - this.itemId = itemId; + public void setId (final Long id) { + this.id = id; } @Override @@ -120,4 +129,13 @@ public abstract class BaseProduct extends BaseEeSystem implements Product, Compa public void setTitle (final String title) { this.title = title; } + + /** + * Getter for logger + * + * @return Logger instance + */ + protected LoggerBeanLocal getLogger () { + return this.logger; + } } diff --git a/src/org/mxchange/jshopcore/model/product/GenericProduct.java b/src/org/mxchange/jshopcore/model/product/GenericProduct.java index 15a40f7..8ff19c4 100644 --- a/src/org/mxchange/jshopcore/model/product/GenericProduct.java +++ b/src/org/mxchange/jshopcore/model/product/GenericProduct.java @@ -17,10 +17,6 @@ package org.mxchange.jshopcore.model.product; import java.text.MessageFormat; -import org.mxchange.jshopcore.model.product.BaseProduct; -import org.mxchange.jshopcore.model.product.BaseProduct; -import org.mxchange.jshopcore.model.product.Product; -import org.mxchange.jshopcore.model.product.Product; /** * Generic product class @@ -54,7 +50,7 @@ public class GenericProduct extends BaseProduct implements Product { this.getLogger().logTrace(MessageFormat.format("id={0},title={1},price={2},categoryId={3},available={4} - CALLED!", id, title, price, categoryId, available)); //NOI18N // Set all here - this.setItemId(id); + this.setId(id); this.setTitle(title); this.setPrice(price); this.setCategoryId(categoryId); diff --git a/src/org/mxchange/jshopcore/model/product/Product.java b/src/org/mxchange/jshopcore/model/product/Product.java index 96bdca0..efcdd7b 100644 --- a/src/org/mxchange/jshopcore/model/product/Product.java +++ b/src/org/mxchange/jshopcore/model/product/Product.java @@ -29,13 +29,13 @@ public interface Product extends Serializable { * * @return Id number of product */ - public Long getItemId (); + public Long getId (); /** * Id number of product * @param id the id number to set */ - public void setItemId (final Long id); + public void setId (final Long id); /** * Getter for title.