From: Roland Haeder Date: Mon, 12 Oct 2015 07:08:12 +0000 (+0200) Subject: added jcountry-core + jcountry-lib + singleton bean for country data retrieval X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cad0d61da236755a1f1428ce7df980e3c88ed1d7;p=pizzaservice-core.git added jcountry-core + jcountry-lib + singleton bean for country data retrieval Signed-off-by:Roland Häder --- diff --git a/PizzaService-ejb/lib/jcountry-core.jar b/PizzaService-ejb/lib/jcountry-core.jar new file mode 100644 index 0000000..7b77495 Binary files /dev/null and b/PizzaService-ejb/lib/jcountry-core.jar differ diff --git a/PizzaService-ejb/lib/jcountry-lib.jar b/PizzaService-ejb/lib/jcountry-lib.jar new file mode 100644 index 0000000..f917c1d Binary files /dev/null and b/PizzaService-ejb/lib/jcountry-lib.jar differ diff --git a/PizzaService-ejb/nbproject/build-impl.xml b/PizzaService-ejb/nbproject/build-impl.xml index 59e4523..79e5a28 100644 --- a/PizzaService-ejb/nbproject/build-impl.xml +++ b/PizzaService-ejb/nbproject/build-impl.xml @@ -828,6 +828,8 @@ exists or setup the property manually. For example like this: + + @@ -836,23 +838,29 @@ exists or setup the property manually. For example like this: + + - + - - - - + + + + + + + + diff --git a/PizzaService-ejb/nbproject/genfiles.properties b/PizzaService-ejb/nbproject/genfiles.properties index a8b312c..084f710 100644 --- a/PizzaService-ejb/nbproject/genfiles.properties +++ b/PizzaService-ejb/nbproject/genfiles.properties @@ -3,6 +3,6 @@ build.xml.script.CRC32=cabe2e92 build.xml.stylesheet.CRC32=5910fda3@1.51.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=8a7af502 -nbproject/build-impl.xml.script.CRC32=d1bf7afb +nbproject/build-impl.xml.data.CRC32=b7f399f9 +nbproject/build-impl.xml.script.CRC32=dcb101ec nbproject/build-impl.xml.stylesheet.CRC32=6096d939@1.51.1 diff --git a/PizzaService-ejb/nbproject/project.properties b/PizzaService-ejb/nbproject/project.properties index eebe2f6..347c750 100644 --- a/PizzaService-ejb/nbproject/project.properties +++ b/PizzaService-ejb/nbproject/project.properties @@ -23,13 +23,15 @@ excludes= file.reference.cdi-api.jar=lib/cdi-api.jar file.reference.jcore-logger-lib.jar=lib/jcore-logger-lib.jar file.reference.jcoreee.jar=lib/jcoreee.jar +file.reference.jcountry-core.jar=lib/jcountry-core.jar +file.reference.jcountry-lib.jar=lib/jcountry-lib.jar file.reference.jshop-core.jar=lib/jshop-core.jar file.reference.jshop-ee-lib.jar=lib/jshop-ee-lib.jar includes=** j2ee.compile.on.save=true j2ee.deploy.on.save=true j2ee.platform=1.7 -j2ee.platform.classpath=${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar +j2ee.platform.classpath=${j2ee.server.middleware}/mq/lib/jaxm-api.jar:${j2ee.server.home}/modules/endorsed/javax.annotation-api.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/bean-validator.jar:${j2ee.server.home}/modules/javax.batch-api.jar:${j2ee.server.home}/modules/javax.ejb-api.jar:${j2ee.server.home}/modules/javax.el.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent-api.jar:${j2ee.server.home}/modules/javax.enterprise.concurrent.jar:${j2ee.server.home}/modules/javax.enterprise.deploy-api.jar:${j2ee.server.home}/modules/javax.faces.jar:${j2ee.server.home}/modules/javax.inject.jar:${j2ee.server.home}/modules/javax.interceptor-api.jar:${j2ee.server.home}/modules/javax.jms-api.jar:${j2ee.server.home}/modules/javax.json.jar:${j2ee.server.home}/modules/javax.mail.jar:${j2ee.server.home}/modules/javax.management.j2ee-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.home}/modules/javax.resource-api.jar:${j2ee.server.home}/modules/javax.security.auth.message-api.jar:${j2ee.server.home}/modules/javax.security.jacc-api.jar:${j2ee.server.home}/modules/javax.servlet-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl-api.jar:${j2ee.server.home}/modules/javax.servlet.jsp.jstl.jar:${j2ee.server.home}/modules/javax.transaction-api.jar:${j2ee.server.home}/modules/javax.websocket-api.jar:${j2ee.server.home}/modules/javax.ws.rs-api.jar:${j2ee.server.home}/modules/javax.xml.registry-api.jar:${j2ee.server.home}/modules/javax.xml.rpc-api.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/weld-osgi-bundle.jar j2ee.platform.embeddableejb.classpath=${j2ee.server.home}/lib/embedded/glassfish-embedded-static-shell.jar j2ee.platform.wscompile.classpath=${j2ee.server.home}/modules/webservices-osgi.jar j2ee.platform.wsgen.classpath=${j2ee.server.home}/modules/webservices-osgi.jar:${j2ee.server.home}/modules/endorsed/webservices-api-osgi.jar:${j2ee.server.home}/modules/jaxb-osgi.jar:${j2ee.server.home}/modules/endorsed/jaxb-api.jar @@ -42,6 +44,8 @@ jars.in.ejbjar=true javac.classpath=\ ${file.reference.jcoreee.jar}:\ ${file.reference.jcore-logger-lib.jar}:\ + ${file.reference.jcountry-core.jar}:\ + ${file.reference.jcountry-lib.jar}:\ ${file.reference.jshop-core.jar}:\ ${file.reference.jshop-ee-lib.jar}:\ ${reference.PizzaService-lib.jar}:\ @@ -85,6 +89,8 @@ runmain.jvmargs= source.encoding=UTF-8 source.reference.jcore-logger-lib.jar=../jcore-logger-lib/src/ source.reference.jcoreee.jar=../../jcoreee/src/ +source.reference.jcountry-core.jar=../jcountry-core/src/ +source.reference.jcountry-lib.jar=../jcountry-lib/src/ source.reference.jshop-core.jar=../../jshop-core/src/ source.reference.jshop-ee-lib.jar=../../jshop-ee-lib/src/ source.root=src diff --git a/PizzaService-ejb/nbproject/project.xml b/PizzaService-ejb/nbproject/project.xml index e6cfa66..aec4efa 100644 --- a/PizzaService-ejb/nbproject/project.xml +++ b/PizzaService-ejb/nbproject/project.xml @@ -1,35 +1,37 @@ - org.netbeans.modules.j2ee.ejbjarproject - - - PizzaService-ejb - 1.6.5 - file.reference.jcoreee.jar - file.reference.jcore-logger-lib.jar - file.reference.jshop-core.jar - file.reference.jshop-ee-lib.jar - reference.PizzaService-lib.jar - file.reference.cdi-api.jar - - - - - - - - - lib/nblibraries.properties - - - - PizzaService-lib - jar - - jar - clean - jar - - - + org.netbeans.modules.j2ee.ejbjarproject + + + PizzaService-ejb + 1.6.5 + file.reference.jcoreee.jar + file.reference.jcore-logger-lib.jar + file.reference.jcountry-core.jar + file.reference.jcountry-lib.jar + file.reference.jshop-core.jar + file.reference.jshop-ee-lib.jar + reference.PizzaService-lib.jar + file.reference.cdi-api.jar + + + + + + + + + lib/nblibraries.properties + + + + PizzaService-lib + jar + + jar + clean + jar + + + diff --git a/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java b/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java new file mode 100644 index 0000000..cabd1f4 --- /dev/null +++ b/PizzaService-ejb/src/java/org/mxchange/jcountry/data/PizzaServiceCountrySingletonBean.java @@ -0,0 +1,49 @@ +/* + * 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 . + */ +package org.mxchange.jcountry.data; + +import java.util.List; +import javax.ejb.Singleton; +import javax.ejb.Startup; +import javax.persistence.Query; +import org.mxchange.jcoreee.database.BaseDatabaseBean; + +/** + * A singleton bean for country informations + *

+ * @author Roland Haeder + */ +@Startup +@Singleton (name = "country", mappedName = "ejb/pizzaservice-singleton-country", description = "A singleton session bean for country informations") +public class PizzaServiceCountrySingletonBean extends BaseDatabaseBean implements CountrySingletonBeanRemote { + + /** + * Serial number + */ + private static final long serialVersionUID = 15_846_983_298_691_207L; + + @Override + @SuppressWarnings ("unchecked") + public List allCountries () { + // Init query + Query query = this.getEntityManager().createNamedQuery("AllCountries"); //NOI18N + + // Return it + return query.getResultList(); + } + +}