From: Roland Häder Date: Mon, 25 Apr 2016 13:56:22 +0000 (+0200) Subject: Continued with customer EJB: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4d433c9d02ca266b2b88e091d02ec4c3cdc8025e;p=pizzaservice-ejb.git Continued with customer EJB: - added EJBs (general and administrative) with all business methods implemented, at least as stub (allCustomers() is finished) - added new depencies jcustomer-core/jcustomer-lib Signed-off-by: Roland Häder --- diff --git a/lib/jcontacts-business-core.jar b/lib/jcontacts-business-core.jar new file mode 100644 index 0000000..d0e5887 Binary files /dev/null and b/lib/jcontacts-business-core.jar differ diff --git a/lib/jcustomer-core.jar b/lib/jcustomer-core.jar new file mode 100644 index 0000000..a3da231 Binary files /dev/null and b/lib/jcustomer-core.jar differ diff --git a/lib/jcustomer-lib.jar b/lib/jcustomer-lib.jar new file mode 100644 index 0000000..aba40f8 Binary files /dev/null and b/lib/jcustomer-lib.jar differ diff --git a/lib/jmailer-ee.jar b/lib/jmailer-ee.jar new file mode 100644 index 0000000..0ad9587 Binary files /dev/null and b/lib/jmailer-ee.jar differ diff --git a/lib/jratecalc-core.jar b/lib/jratecalc-core.jar new file mode 100644 index 0000000..24e1ef0 Binary files /dev/null and b/lib/jratecalc-core.jar differ diff --git a/lib/pizzaservice-core.jar b/lib/pizzaservice-core.jar new file mode 100644 index 0000000..5104d7c Binary files /dev/null and b/lib/pizzaservice-core.jar differ diff --git a/lib/pizzaservice-mailer.jar b/lib/pizzaservice-mailer.jar new file mode 100644 index 0000000..38046f3 Binary files /dev/null and b/lib/pizzaservice-mailer.jar differ diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml index b6a2fcd..3227078 100644 --- a/nbproject/build-impl.xml +++ b/nbproject/build-impl.xml @@ -25,8 +25,8 @@ is divided into following sections: - @@ -749,9 +749,9 @@ or ant -Dj2ee.platform.classpath=<server_classpath> (where no properties f The libs.CopyLibs.classpath property is not set up. -This property must point to +This property must point to org-netbeans-modules-java-j2seproject-copylibstask.jar file which is part -of NetBeans IDE installation and is usually located at +of NetBeans IDE installation and is usually located at <netbeans_installation>/java<version>/ant/extra folder. Either open the project in the IDE and make sure CopyLibs library exists or setup the property manually. For example like this: @@ -828,71 +828,83 @@ exists or setup the property manually. For example like this: - - - - + + + - - + + + + + + + - - - - - + + + - - + + + + + + + - - + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - + + + - - + + + + + + + - diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties index 4d1fc4a..b51b192 100644 --- a/nbproject/genfiles.properties +++ b/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=9c0f08a9 build.xml.stylesheet.CRC32=5910fda3@1.55.1 # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. -nbproject/build-impl.xml.data.CRC32=dfb4c16e -nbproject/build-impl.xml.script.CRC32=c1ee3e42 +nbproject/build-impl.xml.data.CRC32=de14bf5f +nbproject/build-impl.xml.script.CRC32=16d7af10 nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.55.1 diff --git a/nbproject/project.properties b/nbproject/project.properties index 8dee70c..c139995 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -35,6 +35,8 @@ file.reference.jshop-core.jar=lib/jshop-core.jar file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.jar file.reference.juser-core.jar=lib/juser-core.jar file.reference.juser-lib.jar=lib/juser-lib.jar +file.reference.pizzaservice-core.jar=lib/pizzaservice-core.jar +file.reference.pizzaservice-mailer.jar=lib/pizzaservice-mailer.jar includes=** j2ee.compile.on.save=true j2ee.deploy.on.save=true @@ -91,8 +93,7 @@ meta.inf=${source.root}/conf meta.inf.excludes=sun-cmp-mappings.xml platform.active=default_platform project.license=agpl30 -project.pizzaservice-lib=../../pizzaservice-lib -project.PizzaService-lib=../../../public_html/pizzaservice-lib +project.pizzaservice-lib=../pizzaservice-lib reference.PizzaService-lib.jar=${project.PizzaService-lib}/dist/PizzaService-lib.jar resource.dir=setup run.test.classpath=\ @@ -115,6 +116,8 @@ source.reference.jshop-core.jar=../../jshop-core/src/ source.reference.jshop-ee-lib.jar=../../jshop-ee-lib/src/ source.reference.juser-core.jar=../juser-core/src/ source.reference.juser-lib.jar=../juser-lib/src/ +source.reference.pizzaservice-core.jar=../pizzaservice-core/src/ +source.reference.pizzaservice-mailer.jar=../pizzaservice-mailer/src/ source.root=src src.dir=${source.root}/java test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml index bec4a82..8132a7a 100644 --- a/nbproject/project.xml +++ b/nbproject/project.xml @@ -7,19 +7,22 @@ 1.6.5 file.reference.jcore.jar file.reference.jcoreee.jar - file.reference.jcountry-core.jar - file.reference.jcountry-lib.jar file.reference.jcore-logger-lib.jar file.reference.jcontacts-core.jar file.reference.jcontacts-lib.jar - file.reference.juser-core.jar - file.reference.juser-lib.jar + file.reference.jcontacts-business-core.jar + file.reference.jcountry-core.jar + file.reference.jcountry-lib.jar file.reference.jphone-core.jar file.reference.jphone-lib.jar - file.reference.jshop-core.jar - file.reference.jshop-ee-lib.jar + file.reference.juser-core.jar + file.reference.juser-lib.jar + file.reference.jmailer-ee.jar + file.reference.jcustomer-core.jar + file.reference.jcustomer-lib.jar + file.reference.pizzaservice-core.jar + file.reference.pizzaservice-mailer.jar reference.PizzaService-lib.jar - file.reference.cdi-api.jar diff --git a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java new file mode 100644 index 0000000..8d0b967 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 . + */ +package org.mxchange.pizzaapplication.model.customer; + +import java.text.MessageFormat; +import java.util.List; +import javax.ejb.Stateless; +import javax.persistence.Query; +import org.mxchange.jcustomercore.model.customer.Customer; +import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; + +/** + * A stateless administrative customer session bean (EJB) + *

+ * @author Roland Haeder + */ +@Stateless (name = "admincustomer", description = "Administrative bean handling customer data") +public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean implements PizzaAdminCustomerSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 19_845_893_648_175_427L; + + @Override + @SuppressWarnings ("unchecked") + public List allCustomers () { + // Trace message + this.getLoggerBeanLocal().logTrace("allCustomers: CALLED!"); //NOI18N + + // Get named query + Query query = this.getEntityManager().createNamedQuery("AllCustomers", List.class); //NOI18N + + // Get result + List customers = query.getResultList(); + + // Trace message + this.getLoggerBeanLocal().logTrace(MessageFormat.format("allCustomers: customers.size()={0} - EXIT!", customers.size())); //NOI18N + + // Return full list + return customers; + } + +} diff --git a/src/java/org/mxchange/pizzaapplication/model/customer/PizzaCustomerSessionBean.java b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaCustomerSessionBean.java new file mode 100644 index 0000000..8a9a6e3 --- /dev/null +++ b/src/java/org/mxchange/pizzaapplication/model/customer/PizzaCustomerSessionBean.java @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2016 Roland Haeder + * + * 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 . + */ +package org.mxchange.pizzaapplication.model.customer; + +import de.chotime.jratecalc.model.customer.RateCalcCustomerSessionBeanRemote; +import javax.ejb.Stateless; +import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; +; +import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException; +import org.mxchange.jcustomercore.model.customer.Customer;import org.mxchange.jcustomercore.exceptions.CustomerAlreadyRegisteredException; +import org.mxchange.jcustomercore.model.customer.Customer; + +/** + * A stateless customer session bean (EJB) + *

+ * @author Roland Haeder + */ +@Stateless (name = "customer", description = "A bean handling customer data") +public class PizzaCustomerSessionBean extends BasePizzaDatabaseBean implements RateCalcCustomerSessionBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 15_624_759_104_372L; + + @Override + public Customer fillCustomerData (final Customer customer) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public boolean isReqistered (final Customer customer) { + throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. + } + + @Override + public Customer registerCustomer (final Customer customer) throws CustomerAlreadyRegisteredException { + throw new UnsupportedOperationException("Registration by guests is not supported with RateCalc application."); //NOI18N + } + +}