]> git.mxchange.org Git - jjobs-ejb.git/commitdiff
Don't cherry-pick:
authorRoland Häder <roland@mxchange.org>
Wed, 10 Jun 2020 18:36:51 +0000 (20:36 +0200)
committerRoland Häder <roland@mxchange.org>
Wed, 10 Jun 2020 18:36:51 +0000 (20:36 +0200)
- fixed imports and other errors

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java
src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java
src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java
src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java

index 70d2c7064d2248f1cc91c88a20094b81732e0279..c7a3dc3480c6b8c5b2b362fde0f9b933918648c7 100644 (file)
@@ -23,6 +23,7 @@ import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import org.mxchange.jcontacts.model.contact.Contact;
 import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentAlreadyAddedException;
+import org.mxchange.jcontactsbusiness.exceptions.department.DepartmentNotFoundException;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
index 477513cb849c6bf585be05b95ce5c682dafe7fd3..81dc8e345c941be203ba55943c77654d99cc6b22 100644 (file)
@@ -33,6 +33,7 @@ import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffices;
 import org.mxchange.jcontactsbusiness.model.department.Department;
+import org.mxchange.jcontactsbusiness.model.department.Departments;
 import org.mxchange.jcontactsbusiness.model.employee.Employable;
 import org.mxchange.jcontactsbusiness.model.headquarter.Headquarter;
 import org.mxchange.jcontactsbusiness.model.jobposition.HireableJobPosition;
@@ -709,64 +710,13 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                }
 
                // Get contact from it and find it
-               final BranchOffice foundBranchOffice = this.getEntityManager().find(detachedBranchOffice.getClass(), detachedBranchOffice.getBranchId());
+               final DialableMobileNumber foundBranchOffice = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getMobileId());
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: foundBranchOffice={0} - EXIT!", foundBranchOffice)); //NOI18N
 
                // Return it
-               return detachedNumber;
-       }
-
-       /**
-        * Returns a detached instance from given land-line instance
-        * <p>
-        * @param landLineNumber Land-line instance
-        * @param fetchedNumber  Found land-line number in database
-        * <p>
-        * @return Detached instance
-        */
-       protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
-
-               // Should be valid
-               if (null == landLineNumber) {
-                       // Throw NPE
-                       throw new NullPointerException("landLineNumber is null"); //NOI18N
-               } else if (fetchedNumber.getPhoneId() == null) {
-                       // ..and again
-                       throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
-               }
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
-               // Init query instance
-               final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
-
-               // Debug message
-               this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
-               // Default is null
-               DialableLandLineNumber detachedNumber = null;
-
-               // Is there a difference?
-               if (!LandLineNumbers.isSameLandLineNumber(landLineNumber, fetchedNumber)) {
-                       // @TODO Copy all to foundNumber, then merge
-
-                       // Merge this entry
-                       detachedNumber = this.getEntityManager().merge(foundNumber);
-               }
-
-               // Set updated timestamp
-               managedBranchOffice.setBranchEntryUpdated(new Date());
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
-
-               // Return it
-               return detachedNumber;
+               return foundBranchOffice;
        }
 
        /**
@@ -1364,7 +1314,7 @@ public abstract class BaseJobsEnterpriseBean extends BaseEnterpriseBean {
                        // Is the land-line number set?
                        if (other.getContactLandLineNumber() instanceof DialableLandLineNumber) {
                                // Copy land-line number
-                               contact.setContactLandLineNumber(this.getDetached(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
+                               contact.setContactLandLineNumber(this.mergeLandLineNumberData(other.getContactLandLineNumber(), contact.getContactLandLineNumber()));
                        } else {
                                // Null it
                                contact.setContactLandLineNumber(null);
index 3780f4dd045edf8501007457bed164bfd0738222..c673c77c8f94fb44846991b7a3cbe8e417a738a2 100644 (file)
@@ -261,7 +261,7 @@ public class JobsUserSessionBean extends BaseJobsEnterpriseBean implements UserS
        }
 
        @Override
-       public User updateUserData (final User detachedUser) throws UserNotFoundException {
+       public User updateUserData (final User user) throws UserNotFoundException {
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: user={1} - CALLED!", this.getClass().getSimpleName(), user)); //NOI18N
 
@@ -280,7 +280,7 @@ public class JobsUserSessionBean extends BaseJobsEnterpriseBean implements UserS
                        throw new NullPointerException("user.userAccountStatus is null"); //NOI18N
                } else if (!this.ifUserExists(user)) {
                        // User does not exist
-                       throw new UserNotFoundException(detachedUser.getUserId());
+                       throw new UserNotFoundException(user.getUserId());
                }
 
                // Find the instance
index 3795b66945aedc524ed19e0af68b09632a681f50..69470bc262295286f4b7d96aa797e8825cd1876e 100644 (file)
@@ -21,6 +21,7 @@ import java.util.List;
 import java.util.Objects;
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
+import org.mxchange.jjobs.enterprise.BaseJobsEnterpriseBean;
 import org.mxchange.jusercore.exceptions.EmailAddressAlreadyRegisteredException;
 import org.mxchange.jusercore.exceptions.UserNameAlreadyRegisteredException;
 import org.mxchange.jusercore.model.user.AdminUserSessionBeanRemote;