From b9c50317e7ae2be1e44f5431752fd2ba4968cb5f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 25 Jul 2017 23:46:38 +0200 Subject: [PATCH] Possibly cherry-pick: - added initial EJB for business contact-data --- .../FinancialsBusinessDataSessionBean.java | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java diff --git a/src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java new file mode 100644 index 0000000..be569fe --- /dev/null +++ b/src/java/org/mxchange/jcontactsbusiness/FinancialsBusinessDataSessionBean.java @@ -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 . + */ +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 + *

+ * @author Roland Häder + */ +@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 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 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; + } + +} -- 2.39.5