${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
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
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
* @author Roland Haeder
* @param <T> Any instance that implements AddableBasketItem
*/
-public abstract class BaseBasket<T extends AddableBasketItem> extends BaseEeSystem implements Basket<T> {
+public abstract class BaseBasket<T extends AddableBasketItem> implements Basket<T> {
/**
* 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
*/
// Return it
return isAdded;
}
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger instance
+ */
+ private LoggerBeanLocal getLogger () {
+ return this.logger;
+ }
}
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<Category> {
/**
* Serial number
*/
*/
private String title;
+ /**
+ * Logger instance
+ */
+ @EJB
+ @Log
+ private LoggerBeanLocal logger;
+
/**
* Constructor which accepts all database fields
*
public void setTitle (final String title) {
this.title = title;
}
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger instance
+ */
+ private LoggerBeanLocal getLogger () {
+ return this.logger;
+ }
}
*
* @author Roland Haeder
*/
-public interface Category extends Comparable<Category>, Serializable {
+public interface Category extends Serializable {
/**
* Id number of category
* @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);
}
*/
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
/**
* Constructor which accepts all database fields
+ *
* @param id Id number of database record
* @param title Category title
* @param parent Parent id
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;
*
* @author Roland Haeder
*/
-public abstract class BaseItem extends BaseEeSystem implements AddableBasketItem, Comparable<AddableBasketItem> {
+public abstract class BaseItem implements AddableBasketItem, Comparable<AddableBasketItem> {
/**
* Serial number
*/
*/
private Product product;
+ /**
+ * Logger instance
+ */
+ @EJB
+ @Log
+ private LoggerBeanLocal logger;
+
@Override
public int compareTo (final AddableBasketItem item) {
// Trace message
public void setProduct (final Product product) {
this.product = product;
}
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger instance
+ */
+ protected LoggerBeanLocal getLogger () {
+ return this.logger;
+ }
}
}
// Copy all neccessary values
- this.setItemId(product.getItemId());
+ this.setItemId(product.getId());
this.setItemType("Product"); //NOI18N
+
+ // Copy instance
+ this.setProduct(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<Product> {
+public abstract class BaseProduct implements Product, Comparable<Product> {
/**
* Serial number
*/
private Long categoryId;
/**
- * Id number of product item
+ * Id number of product
*/
- private Long itemId;
+ private Long id;
/**
* Price of product
*/
private String title;
+ /**
+ * Logger instance
+ */
+ @EJB
+ @Log
+ private LoggerBeanLocal logger;
+
@Override
public int compareTo (final Product product) {
// Trace message
}
// 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;
}
}
@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
public void setTitle (final String title) {
this.title = title;
}
+
+ /**
+ * Getter for logger
+ *
+ * @return Logger instance
+ */
+ protected LoggerBeanLocal getLogger () {
+ return this.logger;
+ }
}
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
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);
*
* @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.