]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Possibly cherry-pick:
authorRoland Häder <roland@mxchange.org>
Tue, 25 Jul 2017 21:46:38 +0000 (23:46 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 28 Jul 2017 21:36:40 +0000 (23:36 +0200)
- added initial EJB for business contact-data

src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java [new file with mode: 0644]

diff --git a/src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java
new file mode 100644 (file)
index 0000000..be569fe
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2017 Roland Häder
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jcontactsbusiness;
+
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.jfinancials.database.BaseFinancialsDatabaseBean;
+
+/**
+ * A stateless session bean for business data
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "adminBusinessData", description = "An administrative statless bean for handling business data (all)")
+public class FinancialsBusinessDataSessionBean extends BaseFinancialsDatabaseBean implements BusinessDataAdminSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 56_389_504_892_184_571L;
+
+       /**
+        * Default constructor
+        */
+       public FinancialsBusinessDataSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @Override
+       @SuppressWarnings ("unchecked")
+       public List<BusinessBasicData> allBusinessContacts () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allBusinessContacts: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+               // Get query
+               Query query = this.getEntityManager().createNamedQuery("AllBusinessData"); //NOI18N
+
+               // Get list from it
+               List<BusinessBasicData> list = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allBusinessContacts: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+               // Return it
+               return list;
+       }
+
+}