]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Thu, 10 Oct 2019 23:36:29 +0000 (01:36 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 11 Oct 2019 07:09:47 +0000 (09:09 +0200)
- added missing createManaged() methods for Department and HireableJobPosition
- You can do someInstance.getClass() to avoid importing the implementing class
  instead which is more flexible and allows other implementations
- renamed BaseJobsDatabaseBean to BaseJobsEnterpriseBean and moved to proper
  package
- renamed JobPosition to HireableJobPosition (maybe tpzo?)
- renamed classes with "Headquarters" in it to "Headquarter" as "s" is plural
  and should be only used for utility classes
- added missing imports of utility classes
- the registration bean does no longer have isEmailAddressRegistered() and
  isUserNameRegistered() as this exists in user bean, fixed all occurances

Signed-off-by: Roland Häder <roland@mxchange.org>
35 files changed:
nbproject/project.properties
src/java/org/mxchange/jcontacts/model/contact/JobsAdminContactSessionBean.java
src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java
src/java/org/mxchange/jcontacts/model/phone/JobsAdminContactPhoneSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/JobsAdminBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/basicdata/JobsBusinessDataSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/JobsAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/JobsBranchOfficeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/department/JobsDepartmentSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/JobsCompanyEmployeeSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquarterSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquartersSessionBean.java [deleted file]
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquarterSessionBean.java [new file with mode: 0644]
src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquartersSessionBean.java [deleted file]
src/java/org/mxchange/jcontactsbusiness/model/opening_time/JobsAdminOpeningTimesSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/opening_time/JobsOpeningTimesSessionBean.java
src/java/org/mxchange/jcountry/model/data/JobsAdminCountrySingletonBean.java
src/java/org/mxchange/jcountry/model/data/JobsCountrySingletonBean.java
src/java/org/mxchange/jjobs/beans/ejb/BaseJobsEnterpriseBean.java
src/java/org/mxchange/jjobs/model/addressbook/JobsAddressbookSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/JobsAdminMobileProviderSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/mobileprovider/JobsMobileProviderSingletonBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/JobsAdminPhoneSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/JobsPhoneSessionBean.java
src/java/org/mxchange/jusercore/model/user/JobsAdminUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java
src/java/org/mxchange/jusercore/model/user/activity/JobsUserActivityLogMessageBean.java
src/java/org/mxchange/jusercore/model/user/activity/JobsUserActivitySessionBean.java
src/java/org/mxchange/jusercore/model/user/email_address/JobsUserEmailChangeSessionBean.java
src/java/org/mxchange/jusercore/model/user/password_history/JobsUserPasswordHistorySessionBean.java
src/java/org/mxchange/juserlogincore/model/user/login/JobsUserLoginSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/resendlink/JobsResendLinkSessionBean.java

index 7753b2fe17875df96a5057fbbac8fd91deb64832..4d79cedf8db35d5162b5e25592c2ce285e0dcb74 100644 (file)
@@ -47,7 +47,7 @@ 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/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/cdi-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.jar
+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.enterprise-api.jar:${j2ee.server.home}/modules/javax.security.enterprise.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/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/cdi-api.jar:${j2ee.server.home}/modules/javax.persistence.jar:${j2ee.server.middleware}/mq/lib/jaxm-api.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
index a77eae0c6d3a5aace0f9ac662b41b791f02b806e..45019681178b5379575de3e05b891408d90850fc 100644 (file)
@@ -23,7 +23,7 @@ import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * An administrative contact EJB
@@ -31,7 +31,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminContact", description = "An administrative contact EJB")
-public class JobsAdminContactSessionBean extends BaseJobsDatabaseBean implements AdminContactSessionBeanRemote {
+public class JobsAdminContactSessionBean extends BaseJobsEnterpriseBean implements AdminContactSessionBeanRemote {
 
        /**
         * Serial number
index fc6b96d45117e323d6b527a07b4a8b9f19a28dd1..4a92d194ce852a07a5fa280ec9d504f96f05b9b0 100644 (file)
@@ -24,7 +24,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.exceptions.ContactNotFoundException;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A contact EJB
@@ -32,7 +32,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "contact", description = "A bean handling contact data")
-public class JobsContactSessionBean extends BaseJobsDatabaseBean implements ContactSessionBeanRemote {
+public class JobsContactSessionBean extends BaseJobsEnterpriseBean implements ContactSessionBeanRemote {
 
        /**
         * Serial number
index 9f9ada312e0baa1cb26196963a8f65cdee8d2b3e..f49b690f5e7c9dfa51846a012eee4998850072cf 100644 (file)
@@ -22,7 +22,7 @@ import java.util.Objects;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.ContactSessionBeanRemote;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.exceptions.phone.PhoneNumberAlreadyLinkedException;
 import org.mxchange.jphone.exceptions.phone.PhoneNumberNotLinkedException;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
@@ -35,7 +35,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminContactPhone", description = "An administrative bean handling contact's phone (fax, land-line and mobile) data")
-public class JobsAdminContactPhoneSessionBean extends BaseJobsDatabaseBean implements AdminContactsPhoneSessionBeanRemote {
+public class JobsAdminContactPhoneSessionBean extends BaseJobsEnterpriseBean implements AdminContactsPhoneSessionBeanRemote {
 
        /**
         * Serial number
index cf0aa14eeb60cf93bec2e1f133a7c3f7c20ff1cc..12846c037d4bc5195f4b486d24be90803413f9af 100644 (file)
@@ -25,7 +25,7 @@ import javax.ejb.Stateless;
 import org.mxchange.jcontactsbusiness.exceptions.basicdata.BasicDataAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -34,7 +34,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminBasicCompanyData", description = "An administrative statless bean for handling business data (all)")
-public class JobsAdminBusinessDataSessionBean extends BaseJobsDatabaseBean implements AdminBasicCompanyDataSessionBeanRemote {
+public class JobsAdminBusinessDataSessionBean extends BaseJobsEnterpriseBean implements AdminBasicCompanyDataSessionBeanRemote {
 
        /**
         * Serial number
index 9aab0df52ce29ab35e99c6b6d19ff2712185b078..cda0402a5ff075f611182b5627b57c22fde81a60 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for business data
@@ -28,7 +28,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "basicCompanyData", description = "A general statless bean for handling business data (all)")
-public class JobsBusinessDataSessionBean extends BaseJobsDatabaseBean implements BasicCompanyDataSessionBeanRemote {
+public class JobsBusinessDataSessionBean extends BaseJobsEnterpriseBean implements BasicCompanyDataSessionBeanRemote {
 
        /**
         * Serial number
index bcefcf4db61a3b29bc3f53e5bc13cdde6fad4cda..adbc830d52c9338d8b9cf9b738a190bc0991b3ca 100644 (file)
@@ -25,7 +25,7 @@ import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlread
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -34,7 +34,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminBranchOffice", description = "An administrative statless bean for handling branch office data (all)")
-public class JobsAdminBranchOfficeSessionBean extends BaseJobsDatabaseBean implements AdminBranchOfficeSessionBeanRemote {
+public class JobsAdminBranchOfficeSessionBean extends BaseJobsEnterpriseBean implements AdminBranchOfficeSessionBeanRemote {
 
        /**
         * Serial number
index 48f48d014e0331ecee3c646bb2d20f83fb3d17ea..d255fe712637a107b1857c691ead7a9d07dfb07f 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general branch office purposes
@@ -28,7 +28,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "branchOffice", description = "A general statless bean for handling branch office data (all)")
-public class JobsBranchOfficeSessionBean extends BaseJobsDatabaseBean implements BranchOfficeSessionBeanRemote {
+public class JobsBranchOfficeSessionBean extends BaseJobsEnterpriseBean implements BranchOfficeSessionBeanRemote {
 
        /**
         * Serial number
index 1672662999622e1386cb4adda52b021afd0ce273..6a8cb26d3b732bfaea9bda592c7799e1ff516433 100644 (file)
@@ -26,7 +26,7 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -35,7 +35,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminDepartment", description = "An administrative statless bean for handling department data (all)")
-public class JobsAdminDepartmentSessionBean extends BaseJobsDatabaseBean implements AdminDepartmentSessionBeanRemote {
+public class JobsAdminDepartmentSessionBean extends BaseJobsEnterpriseBean implements AdminDepartmentSessionBeanRemote {
 
        /**
         * Serial number
index 5758c15d3283fee5c1ef5bfbb869e35ee3dc69e9..1501b58173aad3613fa8c764bf348a14e025585e 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general department purposes
@@ -28,7 +28,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "department", description = "A general statless bean for handling branch office data (all)")
-public class JobsDepartmentSessionBean extends BaseJobsDatabaseBean implements DepartmentSessionBeanRemote {
+public class JobsDepartmentSessionBean extends BaseJobsEnterpriseBean implements DepartmentSessionBeanRemote {
 
        /**
         * Serial number
index c1fe68371243353c8be8b1a897abb6b83884a290..0d3cb6dc40bcb59dde57f1a0783e9eb7cb8ed46e 100644 (file)
@@ -25,8 +25,8 @@ import org.mxchange.jcontactsbusiness.exceptions.employee.EmployeeAlreadyAddedEx
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import org.mxchange.jcontactsbusiness.model.jobposition.JobPosition;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jusercore.model.user.User;
@@ -37,7 +37,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminEmployee", description = "An administrative statless bean for handling company employees")
-public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean implements AdminCompanyEmployeeSessionBeanRemote {
+public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsEnterpriseBean implements AdminEmployeeSessionBeanRemote {
 
        /**
         * Serial number
@@ -177,9 +177,9 @@ public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean im
                }
 
                // Is headquarter set?
-               if (employee.getEmployeeJobPosition() instanceof JobPosition) {
+               if (employee.getEmployeeJobPosition() instanceof HireableJobPosition) {
                        // Then make it managed
-                       final JobPosition jobPosition = this.createManaged(employee.getEmployeeJobPosition());
+                       final HireableJobPosition jobPosition = this.createManaged(employee.getEmployeeJobPosition());
 
                        // Set it back
                        employee.setEmployeeJobPosition(jobPosition);
index 89ae0a564ec815c5ce2d168177f096e74719a237..d505a61c76f581f68b76c9a94f4031b3e4553d54 100644 (file)
@@ -20,8 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jcontactsbusiness.exceptions.employee.CompanyEmployeeNotFoundException;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless bean for general purposes for company employees.
@@ -29,7 +28,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "employee", description = "A general statless bean for handling company employees")
-public class JobsCompanyEmployeeSessionBean extends BaseJobsDatabaseBean implements CompanyEmployeeSessionBeanRemote {
+public class JobsCompanyEmployeeSessionBean extends BaseJobsEnterpriseBean implements EmployeeSessionBeanRemote {
 
        /**
         * Serial number
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquarterSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquarterSessionBean.java
new file mode 100644 (file)
index 0000000..7f6e77d
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * 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.model.headquarter;
+
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.List;
+import javax.ejb.EJB;
+import javax.ejb.Stateless;
+import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
+import org.mxchange.jcountry.model.data.Country;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jusercore.model.user.User;
+
+/**
+ * A stateless session bean for administrative branch office purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "adminHeadquarter", description = "An administrative statless bean for handling branch office data (all)")
+public class JobsAdminHeadquarterSessionBean extends BaseJobsEnterpriseBean implements AdminHeadquarterSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 58_467_386_571_701L;
+
+       /**
+        * General branch office bean
+        */
+       @EJB (lookup = "java:global/jjobs-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
+       private HeadquarterSessionBeanRemote headquarterBean;
+
+       /**
+        * Default constructor
+        */
+       public JobsAdminHeadquarterSessionBean () {
+               // Call super constructor
+               super();
+       }
+
+       @Override
+       public Headquarter addHeadquarter (final Headquarter headquarter) throws HeadquarterAlreadyAddedException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
+
+               // Validate parameter
+               if (null == headquarter) {
+                       // Throw NPE
+                       throw new NullPointerException("headquarter is null"); //NOI18N
+               } else if (headquarter.getHeadquarterId() instanceof Long) {
+                       // Should not happen
+                       throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
+               } else if (this.isHeadquarterFound(headquarter)) {
+                       // Already added, abort here
+                       throw new HeadquarterAlreadyAddedException(headquarter);
+               }
+
+               // Add created timestamp
+               headquarter.setHeadquarterCreated(new Date());
+
+               // Is user instance set?
+               if (headquarter.getHeadquarterUserOwner() instanceof User) {
+                       // Get managed instance back
+                       final User managedUser = this.createManaged(headquarter.getHeadquarterUserOwner());
+
+                       // Set it back in branch office
+                       headquarter.setHeadquarterUserOwner(managedUser);
+               }
+
+               // Is user instance set?
+               if (headquarter.getHeadquarterCountry() instanceof Country) {
+                       // Get managed instance back
+                       final Country managedCountry = this.createManaged(headquarter.getHeadquarterCountry());
+
+                       // Set it back in branch office
+                       headquarter.setHeadquarterCountry(managedCountry);
+               }
+
+               // Set "created" timestamp on any number assigned
+               this.setAllPhoneEntriesCreated(headquarter);
+
+               // Get opening times
+               final List<OpeningTime> openingTimes = headquarter.getHeadquarterOpeningTimes();
+
+               // Debugging:
+               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarter(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
+
+               // Is opening times set and not empty?
+               if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
+                       // Add created timestamp for all times
+                       this.setAllOpeningTimesCreated(openingTimes);
+               } else {
+                       // Set all to null
+                       headquarter.setHeadquarterOpeningTimes(null);
+               }
+
+               // Persist it
+               this.getEntityManager().persist(headquarter);
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquarterId())); //NOI18N
+
+               // Return updated instance
+               return headquarter;
+       }
+
+       /**
+        * Checks if given branch office's address is already persisted. The whole
+        * (persisted) list is being loaded and each address is being matched
+        * against the given branch office's address.
+        * <p>
+        * @param headquarter Headquarter office being checked
+        * <p>
+        * @return Whether it has been found
+        */
+       private boolean isHeadquarterFound (final Headquarter headquarter) {
+               // Get whole list
+               final List<Headquarter> headquarters = this.headquarterBean.allHeadquarters();
+
+               // Default is not found
+               boolean isFound = false;
+
+               // Check all single addresses
+               for (final Headquarter hq : headquarters) {
+                       // Is the same address found?
+                       if (Headquarters.isSameAddress(hq, headquarter)) {
+                               // Found one
+                               isFound = true;
+                               break;
+                       }
+               }
+
+               // Return flag
+               return isFound;
+       }
+
+}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquartersSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsAdminHeadquartersSessionBean.java
deleted file mode 100644 (file)
index 291a76d..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (C) 2017, 2018 Free Software Foundation
- *
- * 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.model.headquarter;
-
-import java.text.MessageFormat;
-import java.util.Date;
-import java.util.List;
-import javax.ejb.EJB;
-import javax.ejb.Stateless;
-import org.mxchange.jcontactsbusiness.exceptions.headquarter.HeadquarterAlreadyAddedException;
-import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
-import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
-import org.mxchange.jusercore.model.user.User;
-
-/**
- * A stateless session bean for administrative branch office purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "adminHeadquarter", description = "An administrative statless bean for handling branch office data (all)")
-public class JobsAdminHeadquarterSessionBean extends BaseJobsDatabaseBean implements AdminHeadquarterSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 58_467_386_571_701L;
-
-       /**
-        * General branch office bean
-        */
-       @EJB (lookup = "java:global/jjobs-ejb/headquarter!org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote")
-       private HeadquarterSessionBeanRemote headquarterBean;
-
-       /**
-        * Default constructor
-        */
-       public JobsAdminHeadquarterSessionBean () {
-               // Call super constructor
-               super();
-       }
-
-       @Override
-       public Headquarter addHeadquarter (final Headquarter headquarter) throws HeadquarterAlreadyAddedException {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
-
-               // Validate parameter
-               if (null == headquarter) {
-                       // Throw NPE
-                       throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarter.getHeadquarterId() instanceof Long) {
-                       // Should not happen
-                       throw new IllegalArgumentException("headquarter.branchId should not be set."); //NOI18N
-               } else if (this.isHeadquarterFound(headquarter)) {
-                       // Already added, abort here
-                       throw new HeadquarterAlreadyAddedException(headquarter);
-               }
-
-               // Add created timestamp
-               headquarter.setHeadquarterCreated(new Date());
-
-               // Is user instance set?
-               if (headquarter.getHeadquarterUserOwner() instanceof User) {
-                       // Get managed instance back
-                       final User managedUser = this.createManaged(headquarter.getHeadquarterUserOwner());
-
-                       // Set it back in branch office
-                       headquarter.setHeadquarterUserOwner(managedUser);
-               }
-
-               // Is user instance set?
-               if (headquarter.getHeadquarterCountry() instanceof Country) {
-                       // Get managed instance back
-                       final Country managedCountry = this.createManaged(headquarter.getHeadquarterCountry());
-
-                       // Set it back in branch office
-                       headquarter.setHeadquarterCountry(managedCountry);
-               }
-
-               // Set "created" timestamp on any number assigned
-               this.setAllPhoneEntriesCreated(headquarter);
-
-               // Get opening times
-               final List<OpeningTime> openingTimes = headquarter.getHeadquarterOpeningTimes();
-
-               // Debugging:
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.addHeadquarter(): headquarter.headquarterOpeningTimes={1}", this.getClass().getSimpleName(), openingTimes));
-
-               // Is opening times set and not empty?
-               if ((openingTimes instanceof List) && (!openingTimes.isEmpty())) {
-                       // Add created timestamp for all times
-                       this.setAllOpeningTimesCreated(openingTimes);
-               } else {
-                       // Set all to null
-                       headquarter.setHeadquarterOpeningTimes(null);
-               }
-
-               // Persist it
-               this.getEntityManager().persist(headquarter);
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.addHeadquarter(): headquarter.branchId={1} - EXIT!", this.getClass().getSimpleName(), headquarter.getHeadquarterId())); //NOI18N
-
-               // Return updated instance
-               return headquarter;
-       }
-
-       /**
-        * Checks if given branch office's address is already persisted. The whole
-        * (persisted) list is being loaded and each address is being matched
-        * against the given branch office's address.
-        * <p>
-        * @param headquarter Headquarter office being checked
-        * <p>
-        * @return Whether it has been found
-        */
-       private boolean isHeadquarterFound (final Headquarter headquarter) {
-               // Get whole list
-               final List<Headquarter> headquarters = this.headquarterBean.allHeadquarters();
-
-               // Default is not found
-               boolean isFound = false;
-
-               // Check all single addresses
-               for (final Headquarter hq : headquarters) {
-                       // Is the same address found?
-                       if (Headquarters.isSameAddress(hq, headquarter)) {
-                               // Found one
-                               isFound = true;
-                               break;
-                       }
-               }
-
-               // Return flag
-               return isFound;
-       }
-
-}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquarterSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquarterSessionBean.java
new file mode 100644 (file)
index 0000000..85a1417
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2017, 2018 Free Software Foundation
+ *
+ * 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.model.headquarter;
+
+import java.text.MessageFormat;
+import java.util.List;
+import javax.ejb.Stateless;
+import javax.persistence.Query;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+
+/**
+ * A stateless session bean for general headquarter purposes
+ * <p>
+ * @author Roland Häder<roland@mxchange.org>
+ */
+@Stateless (name = "headquarter", description = "A general statless bean for handling headquarter data (all)")
+public class JobsHeadquarterSessionBean extends BaseJobsEnterpriseBean implements HeadquarterSessionBeanRemote {
+
+       /**
+        * Serial number
+        */
+       private static final long serialVersionUID = 58_467_386_571_701L;
+
+       @Override
+       @SuppressWarnings ("unchecked")
+       public List<Headquarter> allHeadquarters () {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
+
+               // Get query
+               final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
+
+               // Get list from it
+               final List<Headquarter> list = query.getResultList();
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+
+               // Return it
+               return list;
+       }
+
+}
diff --git a/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquartersSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/headquarter/JobsHeadquartersSessionBean.java
deleted file mode 100644 (file)
index 1624b84..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Copyright (C) 2017, 2018 Free Software Foundation
- *
- * 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.model.headquarter;
-
-import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
-import java.text.MessageFormat;
-import java.util.List;
-import javax.ejb.Stateless;
-import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
-import org.mxchange.jcontactsbusiness.model.headquarter.HeadquarterSessionBeanRemote;
-
-/**
- * A stateless session bean for general headquarter purposes
- * <p>
- * @author Roland Häder<roland@mxchange.org>
- */
-@Stateless (name = "headquarter", description = "A general statless bean for handling headquarter data (all)")
-public class JobsHeadquarterSessionBean extends BaseJobsDatabaseBean implements HeadquarterSessionBeanRemote {
-
-       /**
-        * Serial number
-        */
-       private static final long serialVersionUID = 58_467_386_571_701L;
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<Headquarter> allHeadquarters () {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: CALLED!", this.getClass().getSimpleName())); //NOI18N
-
-               // Get query
-               final Query query = this.getEntityManager().createNamedQuery("AllHeadquarters"); //NOI18N
-
-               // Get list from it
-               final List<Headquarter> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allHeadquarters: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
-       }
-
-}
index 6b57755db61699200d0cf1e3c5ec47aceff5bd0b..bc266c12a2564c9aed24ba0a58795b69deaef1c4 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jcontactsbusiness.model.opening_time;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for administrative opening times purposes
@@ -27,7 +27,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminOpeningTimes", description = "An administrative statless bean for handling opening times")
-public class JobsAdminOpeningTimesSessionBean extends BaseJobsDatabaseBean implements AdminOpeningTimeSessionBeanRemote {
+public class JobsAdminOpeningTimesSessionBean extends BaseJobsEnterpriseBean implements AdminOpeningTimeSessionBeanRemote {
 
        /**
         * Serial number
index ffdb86f422e3913e278ad956671ebbe7f7c863c8..82444dcccb48a36df8573fed4b17ed0662d5a279 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless session bean for general opening times purposes
@@ -28,7 +28,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "openingTimes", description = "A general statless bean for handling branch office data (all)")
-public class JobsOpeningTimesSessionBean extends BaseJobsDatabaseBean implements OpeningTimeSessionBeanRemote {
+public class JobsOpeningTimesSessionBean extends BaseJobsEnterpriseBean implements OpeningTimeSessionBeanRemote {
 
        /**
         * Serial number
index 24c88032154a7e71df4c879de7f91edeed3d9734..b4ee6da1a8f172c76f229437c9fd35873e5f6c09 100644 (file)
@@ -22,7 +22,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcountry.exceptions.CountryAlreadyAddedException;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A stateless EJB for administrative country purposes
@@ -30,7 +30,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminCountry", description = "A stateless session-scoped bean for administrative country purposes")
-public class JobsAdminCountrySingletonBean extends BaseJobsDatabaseBean implements AdminCountrySessionBeanRemote {
+public class JobsAdminCountrySingletonBean extends BaseJobsEnterpriseBean implements AdminCountrySessionBeanRemote {
 
        /**
         * Serial number
index 9af3476a8a82421c3b2fbe385808341c2c2afdf5..8220021c1a520d7c8ee4983149bcf1302b05a751 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A singleton EJB for country informations
@@ -30,7 +30,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  */
 @Startup
 @Singleton (name = "country", description = "A singleton session-scoped bean for country informations")
-public class JobsCountrySingletonBean extends BaseJobsDatabaseBean implements CountrySingletonBeanRemote {
+public class JobsCountrySingletonBean extends BaseJobsEnterpriseBean implements CountrySingletonBeanRemote {
 
        /**
         * Serial number
index c18d1bd083da27d366dfa468ebeaa631e3210d00..fbe1a43828b899e4c19facfec9127d063f57a895 100644 (file)
@@ -29,19 +29,15 @@ import javax.mail.internet.AddressException;
 import javax.mail.internet.InternetAddress;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.Contacts;
-import org.mxchange.jcontacts.model.contact.UserContact;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
-import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BusinessBranchOffice;
-import org.mxchange.jcontactsbusiness.model.employee.BusinessEmployee;
+import org.mxchange.jcontactsbusiness.model.department.Department;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
-import org.mxchange.jcontactsbusiness.model.headquarter.BusinessHeadquarter;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
+import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
 import org.mxchange.jcontactsbusiness.model.opening_time.OpeningTime;
 import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
 import org.mxchange.jcountry.model.data.Country;
-import org.mxchange.jcountry.model.data.CountryData;
 import org.mxchange.jmailee.model.delivery.wrapper.EmailDeliveryWrapper;
 import org.mxchange.jmailee.model.delivery.wrapper.WrapableEmailDelivery;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
@@ -50,8 +46,8 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobileprovider.MobileProvider;
 import org.mxchange.jphone.utils.PhoneUtils;
-import org.mxchange.jusercore.model.user.LoginUser;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.jusercore.model.user.Users;
 
@@ -110,7 +106,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final Contact managedContact = this.getEntityManager().find(UserContact.class, contact.getContactId());
+               final Contact managedContact = this.getEntityManager().find(contact.getClass(), contact.getContactId());
 
                // Should be there
                assert (managedContact instanceof Contact) : "managedContact is null"; //NOI18N
@@ -146,7 +142,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final Country managedCountry = this.getEntityManager().find(CountryData.class, country.getCountryId());
+               final Country managedCountry = this.getEntityManager().find(country.getClass(), country.getCountryId());
 
                // Should be there
                assert (managedCountry instanceof Country) : "managedCountry is null"; //NOI18N
@@ -182,7 +178,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final BasicData managedBasicData = this.getEntityManager().find(BusinessBasicData.class, basicData.getBasicDataId());
+               final BasicData managedBasicData = this.getEntityManager().find(basicData.getClass(), basicData.getBasicDataId());
 
                // Should be there
                assert (managedBasicData instanceof BasicData) : "managedBasicData is null"; //NOI18N
@@ -218,7 +214,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final BranchOffice managedBranchOffice = this.getEntityManager().find(BusinessBranchOffice.class, headquarter.getBranchId());
+               final BranchOffice managedBranchOffice = this.getEntityManager().find(headquarter.getClass(), headquarter.getBranchId());
 
                // Should be there
                assert (managedBranchOffice instanceof BranchOffice) : "managedBranchOffice is null"; //NOI18N
@@ -230,6 +226,42 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                return managedBranchOffice;
        }
 
+       /**
+        * Get back a managed instance from given department
+        * <p>
+        * @param department Unmanaged/detached department instance
+        * <p>
+        * @return Managed department instance
+        */
+       protected Department createManaged (final Department department) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: department={1} - CALLED!", this.getClass().getSimpleName(), department)); //NOI18N
+
+               // user should not be null
+               if (null == department) {
+                       // Abort here
+                       throw new NullPointerException("department is null"); //NOI18N
+               } else if (department.getDepartmentId() == null) {
+                       // Id is set
+                       throw new NullPointerException("department.departmentId is null"); //NOI18N
+               } else if (department.getDepartmentId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("department.departmentId={0} is invalid", department.getDepartmentId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final Department managedDepartment = this.getEntityManager().find(department.getClass(), department.getDepartmentId());
+
+               // Should be there
+               assert (managedDepartment instanceof Department) : "managedDepartment is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedDepartment={1} - EXIT!", this.getClass().getSimpleName(), managedDepartment)); //NOI18N
+
+               // Return it
+               return managedDepartment;
+       }
+
        /**
         * Get back a managed instance from given employee
         * <p>
@@ -254,7 +286,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final Employable managedEmployee = this.getEntityManager().find(BusinessEmployee.class, employee.getEmployeeId());
+               final Employable managedEmployee = this.getEntityManager().find(employee.getClass(), employee.getEmployeeId());
 
                // Should be there
                assert (managedEmployee instanceof Employable) : "managedEmployee is null"; //NOI18N
@@ -266,6 +298,42 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                return managedEmployee;
        }
 
+       /**
+        * Get back a managed instance from given jobPosition
+        * <p>
+        * @param jobPosition Unmanaged/detached job position instance
+        * <p>
+        * @return Managed job position instance
+        */
+       protected HireableJobPosition createManaged (final HireableJobPosition jobPosition) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: jobPosition={1} - CALLED!", this.getClass().getSimpleName(), jobPosition)); //NOI18N
+
+               // user should not be null
+               if (null == jobPosition) {
+                       // Abort here
+                       throw new NullPointerException("jobPosition is null"); //NOI18N
+               } else if (jobPosition.getJobPositionId() == null) {
+                       // Id is set
+                       throw new NullPointerException("jobPosition.jobPositionId is null"); //NOI18N
+               } else if (jobPosition.getJobPositionId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("jobPosition.jobPositionId={0} is invalid", jobPosition.getJobPositionId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final HireableJobPosition managedJobPosition = this.getEntityManager().find(jobPosition.getClass(), jobPosition.getJobPositionId());
+
+               // Should be there
+               assert (managedJobPosition instanceof HireableJobPosition) : "managedJobPosition is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedJobPosition={1} - EXIT!", this.getClass().getSimpleName(), managedJobPosition)); //NOI18N
+
+               // Return it
+               return managedJobPosition;
+       }
+
        /**
         * Get back a managed instance from given headquarter
         * <p>
@@ -290,7 +358,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final Headquarter managedHeadquarter = this.getEntityManager().find(BusinessHeadquarter.class, headquarter.getHeadquarterId());
+               final Headquarter managedHeadquarter = this.getEntityManager().find(headquarter.getClass(), headquarter.getHeadquarterId());
 
                // Should be there
                assert (managedHeadquarter instanceof Headquarter) : "managedHeadquarter is null"; //NOI18N
@@ -302,6 +370,42 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                return managedHeadquarter;
        }
 
+       /**
+        * Get back a managed instance from given mobile provider
+        * <p>
+        * @param mobileProvider Unmanaged/detached mobile provider instance
+        * <p>
+        * @return Managed mobile provider instance
+        */
+       protected MobileProvider createManaged (final MobileProvider mobileProvider) {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: mobileProvider={1} - CALLED!", this.getClass().getSimpleName(), mobileProvider)); //NOI18N
+
+               // user should not be null
+               if (null == mobileProvider) {
+                       // Abort here
+                       throw new NullPointerException("mobileProvider is null"); //NOI18N
+               } else if (mobileProvider.getProviderId() == null) {
+                       // Id is set
+                       throw new NullPointerException("mobileProvider.providerId is null"); //NOI18N
+               } else if (mobileProvider.getProviderId() < 1) {
+                       // Id is set
+                       throw new IllegalArgumentException(MessageFormat.format("mobileProvider.providerId={0} is invalid", mobileProvider.getProviderId())); //NOI18N
+               }
+
+               // Try to find it (should be there)
+               final MobileProvider managedMobileProvider = this.getEntityManager().find(mobileProvider.getClass(), mobileProvider.getProviderId());
+
+               // Should be there
+               assert (managedMobileProvider instanceof MobileProvider) : "managedMobileProvider is null"; //NOI18N
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedMobileProvider={1} - EXIT!", this.getClass().getSimpleName(), managedMobileProvider)); //NOI18N
+
+               // Return it
+               return managedMobileProvider;
+       }
+
        /**
         * Get back a managed instance from given user
         * <p>
@@ -335,7 +439,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Try to find it (should be there)
-               final User managedUser = this.getEntityManager().find(LoginUser.class, user.getUserId());
+               final User managedUser = this.getEntityManager().find(user.getClass(), user.getUserId());
 
                // Should be there
                assert (managedUser instanceof User) : "managedUser is null"; //NOI18N
index 1824cfb3e44b92e613e055f81b1035ff121e466f..b5730d86658c3d60f8ca4397c6b9a528421035c3 100644 (file)
@@ -17,7 +17,7 @@
 package org.mxchange.jjobs.model.addressbook;
 
 import java.text.MessageFormat;
-import java.util.GregorianCalendar;
+import java.util.Date;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
@@ -28,7 +28,7 @@ import org.mxchange.jaddressbook.exceptions.AddressbookNotFoundException;
 import org.mxchange.jaddressbook.model.addressbook.Addressbook;
 import org.mxchange.jaddressbook.model.addressbook.UserAddressbook;
 import org.mxchange.jaddressbook.model.addressbook.entry.AddressbookEntry;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -37,7 +37,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "addressbook", description = "A stateless bean for handling JJobs addressbooks")
-public class JobsAddressbookSessionBean extends BaseJobsDatabaseBean implements AddressbookSessionBeanRemote {
+public class JobsAddressbookSessionBean extends BaseJobsEnterpriseBean implements AddressbookSessionBeanRemote {
 
        /**
         * Serial number
@@ -111,7 +111,7 @@ public class JobsAddressbookSessionBean extends BaseJobsDatabaseBean implements
                }
 
                // Add timestamp of creation
-               addressbook.setAddressbookCreated(new GregorianCalendar());
+               addressbook.setAddressbookCreated(new Date());
 
                // Persist it now
                this.getEntityManager().persist(addressbook);
index 9f48ec6d3d0c0ac472acda043c14733bebccbe9b..20907b5c8f83bcdc5d0e6956f878774ac359b9f6 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.jphone.model.phonenumbers.mobileprovider;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderAlreadyAddedException;
 
 /**
@@ -28,7 +28,7 @@ import org.mxchange.jphone.exceptions.mobileprovider.MobileProviderAlreadyAddedE
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminMobileProvider", description = "A singleton session-scoped bean for mobile provider informations, admin-edition")
-public class JobsAdminMobileProviderSessionBean extends BaseJobsDatabaseBean implements AdminMobileProviderSessionBeanRemote {
+public class JobsAdminMobileProviderSessionBean extends BaseJobsEnterpriseBean implements AdminMobileProviderSessionBeanRemote {
 
        /**
         * Serial number
index aaf852c11df9c084429f10e63cc140a5ea8a51ae..4684721e5a8e68ea5ab3d3ff18c7aeff14650616 100644 (file)
@@ -21,7 +21,7 @@ import java.util.List;
 import javax.ejb.Singleton;
 import javax.ejb.Startup;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 
 /**
  * A singleton EJB for mobile provider informations
@@ -30,7 +30,7 @@ import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
  */
 @Startup
 @Singleton (name = "mobileProvider", description = "A singleton session-scoped bean for SMS provider informations")
-public class JobsMobileProviderSingletonBean extends BaseJobsDatabaseBean implements MobileProviderSingletonBeanRemote {
+public class JobsMobileProviderSingletonBean extends BaseJobsEnterpriseBean implements MobileProviderSingletonBeanRemote {
 
        /**
         * Serial number
index 54b425db720d12bd74b865efbfbcac5b9115fe88..5eb9c37650441538eee7c71a6e94485cf04d14e1 100644 (file)
@@ -19,8 +19,10 @@ package org.mxchange.jphone.model.phonenumbers.phone;
 import java.text.MessageFormat;
 import java.util.Date;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
-import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
+import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
+import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
+import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
 
 /**
  * An EJB for administrative phone purposes
@@ -28,7 +30,7 @@ import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminPhone", description = "An administrative bean handling phone data")
-public class JobsAdminPhoneSessionBean extends BaseJobsDatabaseBean implements AdminPhoneSessionBeanRemote {
+public class JobsAdminPhoneSessionBean extends BaseJobsEnterpriseBean implements AdminPhoneSessionBeanRemote {
 
        /**
         * Serial number
index 6b53d1ec9b0c36a425ea8c4218265a6ed685852d..c6a29e44180244b5effbde71e651ba186a9ff7d3 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
@@ -34,7 +34,7 @@ import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "phone", description = "A bean handling phone data")
-public class JobsPhoneSessionBean extends BaseJobsDatabaseBean implements PhoneSessionBeanRemote {
+public class JobsPhoneSessionBean extends BaseJobsEnterpriseBean implements PhoneSessionBeanRemote {
 
        /**
         * Serial number
index 4f804a0be1e8a4fadd74bbb0d16f92efe818fe4d..ae9c93a452315f669da9a13e8ce5b61152ad3209 100644 (file)
@@ -21,7 +21,7 @@ import java.util.Date;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
@@ -29,7 +29,6 @@ import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
 import org.mxchange.jusercore.model.user.status.UserAccountStatus;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
 /**
  * An administrative user EJB
@@ -37,19 +36,13 @@ import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBe
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "adminUser", description = "A bean handling the user data")
-public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements AdminUserSessionBeanRemote {
+public class JobsAdminUserSessionBean extends BaseJobsEnterpriseBean implements AdminUserSessionBeanRemote {
 
        /**
         * Serial number
         */
        private static final long serialVersionUID = 542_145_347_916L;
 
-       /**
-        * Registration EJB
-        */
-       @EJB
-       private UserRegistrationSessionBeanRemote registerBean;
-
        /**
         * Regular user bean
         */
@@ -79,10 +72,10 @@ public class JobsAdminUserSessionBean extends BaseJobsDatabaseBean implements Ad
                }
 
                // Check if user is registered
-               if (this.registerBean.isUserNameRegistered(user)) {
+               if (this.userBean.isUserNameRegistered(user)) {
                        // Abort here
                        throw new UserNameAlreadyRegisteredException(user);
-               } else if (this.registerBean.isEmailAddressRegistered(user)) {
+               } else if (this.userBean.isEmailAddressRegistered(user)) {
                        // Abort here
                        throw new EmailAddressAlreadyRegisteredException(user);
                }
index 570cf0f6d0308e6b512c258d3691468071ff9eb3..4b060e4b68a41b36e3bfad20bba5ca4fa9151165 100644 (file)
@@ -27,7 +27,7 @@ import javax.persistence.PersistenceException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontacts.model.contact.Contacts;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
@@ -49,7 +49,7 @@ import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBe
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "user", description = "A bean handling the user data")
-public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSessionBeanRemote {
+public class JobsUserSessionBean extends BaseJobsEnterpriseBean implements UserSessionBeanRemote {
 
        /**
         * Serial number
index 2cdf04d42bb74a3033c63787a0cdd4e6cf1b5a7a..1999b584cae464383a294baf0daa5ced8cbf4310 100644 (file)
@@ -23,7 +23,7 @@ import javax.ejb.Stateless;
 import javax.jms.JMSException;
 import javax.jms.ObjectMessage;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -32,7 +32,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userActivity", description = "A stateless, session-scored user-activity bean.")
-public class JobsUserActivitySessionBean extends BaseJobsDatabaseBean implements UserActivityLogSessionBeanRemote {
+public class JobsUserActivityLogMessageBean extends BaseJobsEnterpriseBean implements UserActivityLogSessionBeanRemote {
 
        /**
         * Serial number
@@ -42,7 +42,7 @@ public class JobsUserActivitySessionBean extends BaseJobsDatabaseBean implements
        /**
         * Default constructor
         */
-       public JobsUserActivitySessionBean () {
+       public JobsUserActivityLogMessageBean () {
                // Invoke super constructor
                super("jms/jjobs-queue-factory", "jms/jjobs-user-activity-log"); //NOI18N
        }
index bce8f4a7e3c588384d55b39ce1425f5eeb8fb3f1..8eb06196a02d0806e5001f96911bd9c3ec6b108d 100644 (file)
 package org.mxchange.jusercore.model.user.activity;
 
 import java.text.MessageFormat;
-import java.util.Arrays;
 import java.util.List;
 import javax.ejb.EJBException;
 import javax.ejb.Stateless;
 import javax.jms.JMSException;
 import javax.jms.ObjectMessage;
 import javax.persistence.Query;
-import org.mxchange.jcoreee.database.BaseDatabaseBean;
+import org.mxchange.jcoreee.bean.ejb.BaseEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
- * An EJB for user activity log. This class extends BaseDatabaseBean and not
+ * An EJB for user activity log. This class extends BaseEnterpriseBean and not
  * project-specific "base class". The simple reason is that this class requires
  * no email queue as no emails are ever being sent from this class.
  * <p>
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userActivity", description = "A bean handling the user data")
-public class JobsUserActivitySessionBean extends BaseDatabaseBean implements UserActivityLogSessionBeanRemote {
+public class JobsUserActivitySessionBean extends BaseEnterpriseBean implements UserActivityLogSessionBeanRemote {
 
        /**
         * Serial number
@@ -145,85 +144,4 @@ public class JobsUserActivitySessionBean extends BaseDatabaseBean implements Use
                return list;
        }
 
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<LogableUserActivity> fetchAllUsersActivityLogByMultipleType (final User user, final String[] activityTypes) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLogByType: user={1},activityTypes={2} - CALLED!", this.getClass().getSimpleName(), user, Arrays.toString(activityTypes))); //NOI18N
-
-               // Is user valid?
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId{0} is not valid", user.getUserId())); //NOI18N
-               } else if (null == activityTypes) {
-                       // Throw NPE again
-                       throw new NullPointerException("activityTypes is null"); //NOI18N
-               } else if (activityTypes.length == 0) {
-                       // Should not be empty
-                       throw new IllegalArgumentException("activityTypes is empty"); //NOI18N
-               }
-
-               // Search for user's activity
-               Query query = this.getEntityManager().createNamedQuery("FindUsersActivityByMultipleTypes", UserActivityLog.class); //NOI18N
-
-               // Set parameters
-               query.setParameter("activityUser", user); //NOI18N
-               query.setParameter("activityTypes", Arrays.asList(activityTypes)); //NOI18N
-
-               // Get list
-               List<LogableUserActivity> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLogByType: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
-       }
-
-       @Override
-       @SuppressWarnings ("unchecked")
-       public List<LogableUserActivity> fetchAllUsersActivityLogByType (final User user, final String activityType) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLogByType: user={1},activityType={2} - CALLED!", this.getClass().getSimpleName(), user, activityType)); //NOI18N
-
-               // Is user valid?
-               if (null == user) {
-                       // Throw NPE
-                       throw new NullPointerException("user is null"); //NOI18N
-               } else if (user.getUserId() == null) {
-                       // Throw again
-                       throw new NullPointerException("user.userId is null"); //NOI18N
-               } else if (user.getUserId() < 1) {
-                       // Invalid id number
-                       throw new IllegalArgumentException(MessageFormat.format("user.userId{0} is not valid", user.getUserId())); //NOI18N
-               } else if (null == activityType) {
-                       // Throw NPE again
-                       throw new NullPointerException("activityType is null"); //NOI18N
-               } else if (activityType.isEmpty()) {
-                       // Should not be empty
-                       throw new IllegalArgumentException("activityType is empty"); //NOI18N
-               }
-
-               // Search for user's activity
-               Query query = this.getEntityManager().createNamedQuery("FindUsersActivityByType", UserActivityLog.class); //NOI18N
-
-               // Set parameters
-               query.setParameter("activityUser", user); //NOI18N
-               query.setParameter("activityType", activityType); //NOI18N
-
-               // Get list
-               List<LogableUserActivity> list = query.getResultList();
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.fetchAllUsersActivityLogByType: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
-
-               // Return it
-               return list;
-       }
 }
index 9e5610f752647fbb5630217bdc60a6a5e8f3efa9..0de00096b7172319681fa4d8f4ef0080a60c9a77 100644 (file)
@@ -24,7 +24,7 @@ import javax.ejb.EJBException;
 import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.email_address.ChangeableEmailAddress;
 import org.mxchange.jusercore.model.email_address.EmailAddressChange;
 import org.mxchange.jusercore.model.user.UserSessionBeanRemote;
@@ -36,7 +36,7 @@ import org.mxchange.juserlogincore.login.UserLoginUtils;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userEmailChange", description = "A bean handling user email changes")
-public class JobsUserEmailChangeSessionBean extends BaseJobsDatabaseBean implements UserEmailChangeSessionBeanRemote {
+public class JobsUserEmailChangeSessionBean extends BaseJobsEnterpriseBean implements UserEmailChangeSessionBeanRemote {
 
        /**
         * Serial number
index 24081d7588308746d3cabf97a46c29f494e698c5..728e68db0a1398770e85d4b885b8923c8354e94f 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.List;
 import javax.ejb.Stateless;
 import javax.persistence.Query;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.model.user.User;
 
 /**
@@ -29,7 +29,7 @@ import org.mxchange.jusercore.model.user.User;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userPasswordHistory", description = "A stateless EJB for user's password history. This bean does return the full user's password history and not limited. The application then needs to limit it to it's purpose.")
-public class JobsUserPasswordHistorySessionBean extends BaseJobsDatabaseBean implements UserPasswordHistorySessionBeanRemote {
+public class JobsUserPasswordHistorySessionBean extends BaseJobsEnterpriseBean implements UserPasswordHistorySessionBeanRemote {
 
        /**
         * Serial number
index 4dfd1f2b64f5e8423393475217bbefbaf4c22d8b..1b3f6209b1940323b33c45664f947af4d46b343f 100644 (file)
@@ -19,7 +19,7 @@ package org.mxchange.juserlogincore.model.user.login;
 import java.text.MessageFormat;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
 import org.mxchange.jusercore.exceptions.UserStatusUnconfirmedException;
@@ -29,7 +29,6 @@ import org.mxchange.jusercore.model.user.status.UserAccountStatus;
 import org.mxchange.juserlogincore.container.login.LoginContainer;
 import org.mxchange.juserlogincore.exceptions.UserPasswordMismatchException;
 import org.mxchange.juserlogincore.login.UserLoginUtils;
-import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBeanRemote;
 
 /**
  * A session EJB for user logins
@@ -37,19 +36,13 @@ import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBe
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userLogin", description = "A bean handling the user login for Jobs project")
-public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements UserLoginSessionBeanRemote {
+public class JobsUserLoginSessionBean extends BaseJobsEnterpriseBean implements UserLoginSessionBeanRemote {
 
        /**
         * Serial number
         */
        private static final long serialVersionUID = 21_785_978_127_581_965L;
 
-       /**
-        * Registration EJB
-        */
-       @EJB
-       private UserRegistrationSessionBeanRemote registerBean;
-
        /**
         * User EJB
         */
@@ -69,10 +62,6 @@ public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.loginUser: container={1} - CALLED!", this.getClass().getSimpleName(), container)); //NOI18N
 
-               // Check some beans
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-               assert (this.registerBean instanceof UserRegistrationSessionBeanRemote) : "this.registerBean is not set"; //NOI18N
-
                // user should not be null
                if (null == container) {
                        // Abort here
@@ -89,7 +78,7 @@ public class JobsUserLoginSessionBean extends BaseJobsDatabaseBean implements Us
                }
 
                // Is the account there?
-               if (!this.registerBean.isUserNameRegistered(container.getUser())) {
+               if (!this.userBean.isUserNameRegistered(container.getUser())) {
                        // Not registered
                        throw new UserNotFoundException(container.getUser());
                }
index 6fd5fa13b804141d898d63aa0b9c526c15f42ffb..069e17aa2934e1a0e4abdb5e7c4f095d3e6f0356 100644 (file)
@@ -23,7 +23,7 @@ import javax.ejb.Stateless;
 import javax.persistence.NoResultException;
 import javax.persistence.Query;
 import org.mxchange.jcontacts.model.contact.Contact;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote;
@@ -38,7 +38,7 @@ import org.mxchange.juserlogincore.login.UserLoginUtils;
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userRegistration", description = "A bean handling the user registration")
-public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implements UserRegistrationSessionBeanRemote {
+public class JobsUserRegistrationSessionBean extends BaseJobsEnterpriseBean implements UserRegistrationSessionBeanRemote {
 
        /**
         * Serial number
@@ -111,42 +111,6 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
                return confirmationKey;
        }
 
-       @Override
-       public boolean isEmailAddressRegistered (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isEmailAddressRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // Check bean
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               }
-
-               // Call other bean
-               return this.userBean.isEmailAddressRegistered(user);
-       }
-
-       @Override
-       public boolean isUserNameRegistered (final User user) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isUserNameRegistered: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
-
-               // Check bean
-               assert (this.userBean instanceof UserSessionBeanRemote) : "this.userBean is not set"; //NOI18N
-
-               // user should not be null
-               if (null == user) {
-                       // Abort here
-                       throw new NullPointerException("user is null"); //NOI18N
-               }
-
-               // Call other bean
-               return this.userBean.isUserNameRegistered(user);
-       }
-
        @Override
        public User registerUser (final User user, final String baseUrl, final String randomPassword) throws UserNameAlreadyRegisteredException, EmailAddressAlreadyRegisteredException {
                // Trace message
@@ -168,10 +132,10 @@ public class JobsUserRegistrationSessionBean extends BaseJobsDatabaseBean implem
                }
 
                // Check if user is registered
-               if (this.isUserNameRegistered(user)) {
+               if (this.userBean.isUserNameRegistered(user)) {
                        // Abort here
                        throw new UserNameAlreadyRegisteredException(user);
-               } else if (this.isEmailAddressRegistered(user)) {
+               } else if (this.userBean.isEmailAddressRegistered(user)) {
                        // Abort here
                        throw new EmailAddressAlreadyRegisteredException(user);
                }
index d252b23a0213e6b2759797447d1fb8b305ed1b87..03315962c949c29da5d6de85cc13115fecebeb8a 100644 (file)
@@ -20,7 +20,7 @@ import java.text.MessageFormat;
 import java.util.Locale;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
-import org.mxchange.jjobs.database.BaseJobsDatabaseBean;
+import org.mxchange.jjobs.beans.ejb.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.UserNotFoundException;
 import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
 import org.mxchange.jusercore.exceptions.UserStatusLockedException;
@@ -36,7 +36,7 @@ import org.mxchange.juserlogincore.model.user.register.UserRegistrationSessionBe
  * @author Roland Häder<roland@mxchange.org>
  */
 @Stateless (name = "userResendConfirmationLink", description = "A bean resending confirmation links")
-public class JobsResendLinkSessionBean extends BaseJobsDatabaseBean implements ResendLinkSessionBeanRemote {
+public class JobsResendLinkSessionBean extends BaseJobsEnterpriseBean implements ResendLinkSessionBeanRemote {
 
        /**
         * Serial number