From: Roland Häder Date: Wed, 10 Jun 2020 18:36:51 +0000 (+0200) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=74e1eff3173da6aea42b335d313381ea75db3e9d;p=jjobs-ejb.git Don't cherry-pick: - fixed imports and other errors Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java index 70d2c70..c7a3dc3 100644 --- a/src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java +++ b/src/java/org/mxchange/jcontactsbusiness/model/department/JobsAdminDepartmentSessionBean.java @@ -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; diff --git a/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java b/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java index 477513c..81dc8e3 100644 --- a/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java +++ b/src/java/org/mxchange/jjobs/enterprise/BaseJobsEnterpriseBean.java @@ -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 - *

- * @param landLineNumber Land-line instance - * @param fetchedNumber Found land-line number in database - *

- * @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); diff --git a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java index 3780f4d..c673c77 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java @@ -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 diff --git a/src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java b/src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java index 3795b66..69470bc 100644 --- a/src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java +++ b/src/java/org/mxchange/juserlogincore/model/user/register/JobsUserRegistrationSessionBean.java @@ -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;