From 18bf4040415c496e00723eae991591a6f922c63d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 16 Oct 2017 20:30:17 +0200 Subject: [PATCH] Continued: - renamed remote interfaces for employees as there is no need for explicit company employees - removed all find*ById() as they were a performance problem - removed more that causes unneccessary load on EJB container MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- ...dminBasicCompanyDataSessionBeanRemote.java | 8 +++--- .../BasicCompanyDataSessionBeanRemote.java | 26 +------------------ .../BranchOfficeSessionBeanRemote.java | 12 --------- .../DepartmentSessionBeanRemote.java | 14 ---------- ...va => AdminEmployeeSessionBeanRemote.java} | 2 +- ...te.java => EmployeeSessionBeanRemote.java} | 17 ++---------- .../OpeningTimeSessionBeanRemote.java | 14 ---------- 7 files changed, 8 insertions(+), 85 deletions(-) rename src/org/mxchange/jcontactsbusiness/model/employee/{AdminCompanyEmployeeSessionBeanRemote.java => AdminEmployeeSessionBeanRemote.java} (92%) rename src/org/mxchange/jcontactsbusiness/model/employee/{CompanyEmployeeSessionBeanRemote.java => EmployeeSessionBeanRemote.java} (65%) diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/AdminBasicCompanyDataSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/AdminBasicCompanyDataSessionBeanRemote.java index b5bff98..97563dc 100644 --- a/src/org/mxchange/jcontactsbusiness/model/basicdata/AdminBasicCompanyDataSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/basicdata/AdminBasicCompanyDataSessionBeanRemote.java @@ -18,8 +18,8 @@ package org.mxchange.jcontactsbusiness.model.basicdata; import java.io.Serializable; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataAlreadyAddedException; -import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; +import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException; +import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; /** * A remote interface for business contact data @@ -37,9 +37,9 @@ public interface AdminBasicCompanyDataSessionBeanRemote extends Serializable { *

* @return Updated basic data *

- * @throws BasicCompanyDataAlreadyAddedException If the company name was already + * @throws BasicDataAlreadyAddedException If the company name was already * found */ - BusinessBasicData addCompanyBasicData (final BusinessBasicData basicData) throws BasicCompanyDataAlreadyAddedException; + BasicData addBusinessBasicData (final BasicData basicData) throws BasicDataAlreadyAddedException; } diff --git a/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicCompanyDataSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicCompanyDataSessionBeanRemote.java index 967fcb2..6ddbb70 100644 --- a/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicCompanyDataSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/basicdata/BasicCompanyDataSessionBeanRemote.java @@ -16,11 +16,9 @@ */ package org.mxchange.jcontactsbusiness.model.basicdata; -import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataNotFoundException; /** * A remote interface for business contact data @@ -30,34 +28,12 @@ import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicCompanyDataNotFo @Remote public interface BasicCompanyDataSessionBeanRemote extends Serializable { - /** - * Checks whether given company name already exists - *

- * @param companyName Company name to check - *

- * @return Whether the company name exists - */ - Boolean isCompanyNameUsed (final String companyName); - - /** - * Retrieves a single business data entity for given id number or throws a - * proper exception if not found. - *

- * @param basicDataId Company basic data id to lookup - *

- * @return Business contact instance - *

- * @throws BasicCompanyDataNotFoundException If the id number could not be - * looked up and solved into an entity - */ - BusinessBasicData findBasicDataById (final Long basicDataId) throws BasicCompanyDataNotFoundException; - /** * Returns a list, even empty if not thing found, from all business * contacts. NULL should not be returned by this method. *

* @return A list with all business contacts */ - List allCompanyBasicData (); + List allBusinessBasicData (); } diff --git a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOfficeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOfficeSessionBeanRemote.java index 7a70924..e917a49 100644 --- a/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOfficeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/branchoffice/BranchOfficeSessionBeanRemote.java @@ -19,7 +19,6 @@ package org.mxchange.jcontactsbusiness.model.branchoffice; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFoundException; /** * A remote interface for branch offices @@ -29,17 +28,6 @@ import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeNotFou @Remote public interface BranchOfficeSessionBeanRemote extends Serializable { - /** - * Tries to find a branch office with given id number - *

- * @param branchOfficeId Branch office id - *

- * @return A branch office instance - *

- * @throws BranchOfficeNotFoundException If the branch office was not found - */ - BranchOffice findBranchOfficeById (final Long branchOfficeId) throws BranchOfficeNotFoundException; - /** * Returns a list of all branch offices *

diff --git a/src/org/mxchange/jcontactsbusiness/model/department/DepartmentSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/department/DepartmentSessionBeanRemote.java index 53281e9..0417998 100644 --- a/src/org/mxchange/jcontactsbusiness/model/department/DepartmentSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/department/DepartmentSessionBeanRemote.java @@ -19,7 +19,6 @@ package org.mxchange.jcontactsbusiness.model.department; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException; /** * A remote interface for departments @@ -29,19 +28,6 @@ import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundEx @Remote public interface DepartmentSessionBeanRemote extends Serializable { - /** - * Retrieves a single company department entity for given id number or - * throws a proper exception if not found. - *

- * @param departmentId Company department id to lookup - *

- * @return Company department instance - *

- * @throws DepartmentNotFoundException If the id number could not be - * looked up and solved into an entity - */ - Department findDepartmentById (final Long departmentId) throws DepartmentNotFoundException; - /** * Returns a list, even empty if not thing found, from all company * departments. NULL should not be returned by this method. diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/AdminCompanyEmployeeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/employee/AdminEmployeeSessionBeanRemote.java similarity index 92% rename from src/org/mxchange/jcontactsbusiness/model/employee/AdminCompanyEmployeeSessionBeanRemote.java rename to src/org/mxchange/jcontactsbusiness/model/employee/AdminEmployeeSessionBeanRemote.java index 0f8fd97..5b7c896 100644 --- a/src/org/mxchange/jcontactsbusiness/model/employee/AdminCompanyEmployeeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/employee/AdminEmployeeSessionBeanRemote.java @@ -25,6 +25,6 @@ import javax.ejb.Remote; * @author Roland Häder */ @Remote -public interface AdminCompanyEmployeeSessionBeanRemote extends Serializable { +public interface AdminEmployeeSessionBeanRemote extends Serializable { } diff --git a/src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployeeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/employee/EmployeeSessionBeanRemote.java similarity index 65% rename from src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployeeSessionBeanRemote.java rename to src/org/mxchange/jcontactsbusiness/model/employee/EmployeeSessionBeanRemote.java index f51b26f..78c748b 100644 --- a/src/org/mxchange/jcontactsbusiness/model/employee/CompanyEmployeeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/employee/EmployeeSessionBeanRemote.java @@ -19,7 +19,6 @@ package org.mxchange.jcontactsbusiness.model.employee; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoundException; /** * An interface for company employee data being handled @@ -27,25 +26,13 @@ import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoun * @author Roland Häder */ @Remote -public interface CompanyEmployeeSessionBeanRemote extends Serializable { +public interface EmployeeSessionBeanRemote extends Serializable { /** * Returns a list of all company employees (regardless in which company they work) *

* @return A list of all company employees */ - List allCompanyEmployees (); - - /** - * Finds a company employee by given employee id - *

- * @param employeeId Employee id to find company employee instance for - *

- * @return Company employee instance - *

- * @throws CompanyEmployeeNotFoundException If the company employee was not - * found - */ - Employee findCompanyEmployeeById (final Long employeeId) throws CompanyEmployeeNotFoundException; + List allEmployees (); } diff --git a/src/org/mxchange/jcontactsbusiness/model/opening_time/OpeningTimeSessionBeanRemote.java b/src/org/mxchange/jcontactsbusiness/model/opening_time/OpeningTimeSessionBeanRemote.java index 249668c..7e0dae1 100644 --- a/src/org/mxchange/jcontactsbusiness/model/opening_time/OpeningTimeSessionBeanRemote.java +++ b/src/org/mxchange/jcontactsbusiness/model/opening_time/OpeningTimeSessionBeanRemote.java @@ -19,7 +19,6 @@ package org.mxchange.jcontactsbusiness.model.opening_time; import java.io.Serializable; import java.util.List; import javax.ejb.Remote; -import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoundException; /** * A remote interface for opening times @@ -29,19 +28,6 @@ import org.mxchange.jcontactsbusiness.exceptions.opening_time.OpeningTimeNotFoun @Remote public interface OpeningTimeSessionBeanRemote extends Serializable { - /** - * Retrieves a single company department entity for given id number or - * throws a proper exception if not found. - *

- * @param openingId Company department id to lookup - *

- * @return Company department instance - *

- * @throws OpeningTimeNotFoundException If the id number could not be looked - * up and solved into an entity - */ - OpeningTime findOpeningTimesById (final Long openingId) throws OpeningTimeNotFoundException; - /** * Returns a list, even empty if not thing found, from all opening times. * NULL should not be returned by this method. -- 2.39.5