From: Roland Häder Date: Sun, 18 Mar 2018 21:25:50 +0000 (+0100) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b47555d237ff22a82f0e7cfb5fdb9563148a0ff7;p=jjobs-ejb.git Please cherry-pick: - ContactUtils was renamed to Contacts to follow naming-convention - fixed copy-paste mistake for headquarters instance, was BasicData - also employeePosition was renamed to employeeJobPosition Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java b/src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java index a6d97d6..fc6b96d 100644 --- a/src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/model/contact/JobsContactSessionBean.java @@ -107,7 +107,7 @@ public class JobsContactSessionBean extends BaseJobsDatabaseBean implements Cont final Contact next = iterator.next(); // Is same contact? - if ((Objects.equals(contact, next)) || (ContactUtils.isSameContact(contact, next))) { + if ((Objects.equals(contact, next)) || (Contacts.isSameContact(contact, next))) { // Debug message this.getLoggerBeanLocal().logDebug(MessageFormat.format("{0}.isContactFound: Found same contact: contactId={1}", this.getClass().getSimpleName(), next.getContactId())); //NOI18N diff --git a/src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java b/src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java index b03421f..c1fe683 100644 --- a/src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java +++ b/src/java/org/mxchange/jcontactsbusiness/model/employee/JobsAdminCompanyEmployeeSessionBean.java @@ -69,15 +69,15 @@ public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean im } else if (employee.getEmployeeId() != null) { // Throw IAE throw new IllegalArgumentException(MessageFormat.format("employee.employeeId={0} is unexpected.", employee.getEmployeeId())); //NOI18N - } else if (employee.getEmployeeCompany() == null) { + } else if (employee.getEmployeeBasicData() == null) { // Throw NPE throw new NullPointerException("employee.employeeCompany is null"); //NOI18N - } else if (employee.getEmployeeCompany().getBasicDataId() == null) { + } else if (employee.getEmployeeBasicData().getBasicDataId() == null) { // Throw it again throw new NullPointerException("employee.employeeCompany.basicDataId is null"); //NOI18N - } else if (employee.getEmployeeCompany().getBasicDataId() < 1) { + } else if (employee.getEmployeeBasicData().getBasicDataId() < 1) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("employee.employeeCompany.basicDataId={0} is invalid.", employee.getEmployeeCompany().getBasicDataId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("employee.employeeCompany.basicDataId={0} is invalid.", employee.getEmployeeBasicData().getBasicDataId())); //NOI18N } else if (employee.getEmployeeBranchOffice() == null && employee.getEmployeeDepartment() == null && employee.getEmployeeHeadquarter() == null) { // At least one must be set throw new NullPointerException("employee.employeeBranchOffice, employee.employeeDepartment and employee.employeeHeadquarter is null"); //NOI18N @@ -120,12 +120,12 @@ public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean im } else if ((employee.getEmployeePersonalData() != null) && (employee.getEmployeePersonalData().getContactId() < 1)) { // Throw IAE throw new IllegalArgumentException(MessageFormat.format("employee.employeePersonalData.contactId={0} is unexpected.", employee.getEmployeePersonalData().getContactId())); //NOI18N - } else if ((employee.getEmployeePosition() != null) && (employee.getEmployeePosition().getJobPositionId() == null)) { + } else if ((employee.getEmployeeJobPosition() != null) && (employee.getEmployeeJobPosition().getJobPositionId() == null)) { // Throw NPE throw new NullPointerException("employee.employeePosition.jobPositionId is null"); //NOI18N - } else if ((employee.getEmployeePosition() != null) && (employee.getEmployeePosition().getJobPositionId() < 1)) { + } else if ((employee.getEmployeeJobPosition() != null) && (employee.getEmployeeJobPosition().getJobPositionId() < 1)) { // Throw IAE - throw new IllegalArgumentException(MessageFormat.format("employee.employeePosition.jobPositionId={0} is unexpected.", employee.getEmployeePosition().getJobPositionId())); //NOI18N + throw new IllegalArgumentException(MessageFormat.format("employee.employeePosition.jobPositionId={0} is unexpected.", employee.getEmployeeJobPosition().getJobPositionId())); //NOI18N } else if ((employee.getEmployeeUserOwner() != null) && (employee.getEmployeeUserOwner().getUserId() == null)) { // Throw NPE throw new NullPointerException("employee.employeeUserOwner.userId is null"); //NOI18N @@ -138,7 +138,7 @@ public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean im } // Make company (basic data) managed - employee.setEmployeeCompany(this.createManaged(employee.getEmployeeCompany())); + employee.setEmployeeBasicData(this.createManaged(employee.getEmployeeBasicData())); // Is branch office set? if (employee.getEmployeeBranchOffice() instanceof BranchOffice) { @@ -177,12 +177,12 @@ public class JobsAdminCompanyEmployeeSessionBean extends BaseJobsDatabaseBean im } // Is headquarter set? - if (employee.getEmployeePosition() instanceof JobPosition) { + if (employee.getEmployeeJobPosition() instanceof JobPosition) { // Then make it managed - final JobPosition jobPosition = this.createManaged(employee.getEmployeePosition()); + final JobPosition jobPosition = this.createManaged(employee.getEmployeeJobPosition()); // Set it back - employee.setEmployeePosition(jobPosition); + employee.setEmployeeJobPosition(jobPosition); } // Is headquarter set? diff --git a/src/java/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java b/src/java/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java index e8e3fd1..f58c9f7 100644 --- a/src/java/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java +++ b/src/java/org/mxchange/jjobs/database/BaseJobsDatabaseBean.java @@ -28,8 +28,7 @@ import javax.mail.Address; import javax.mail.internet.AddressException; import javax.mail.internet.InternetAddress; import org.mxchange.jcontacts.model.contact.Contact; -import org.mxchange.jcontacts.model.contact.ContactUtils; -import org.mxchange.jcontacts.model.contact.UserContact; +import org.mxchange.jcontacts.model.contact.Contacts; import org.mxchange.jcontactsbusiness.model.basicdata.BasicData; import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData; import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice; @@ -500,7 +499,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { final Headquarter managedHeadquarters = this.getEntityManager().find(BusinessHeadquarters.class, headquarters.getHeadquartersId()); // Should be there - assert (managedHeadquarters instanceof BasicData) : "managedHeadquarters is null"; //NOI18N + assert (managedHeadquarter instanceof Headquarter) : "managedHeadquarter is null"; //NOI18N // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarters={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarters)); //NOI18N @@ -991,7 +990,7 @@ public abstract class BaseJobsDatabaseBean extends BaseDatabaseBean { final Contact managedContact = this.getEntityManager().merge(foundContact); // Copy all - ContactUtils.copyAll(detachedContact, managedContact); + Contacts.copyAll(detachedContact, managedContact); // Trace message this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: foundContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N diff --git a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java index eda7d64..7e9fc32 100644 --- a/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/JobsUserSessionBean.java @@ -26,7 +26,7 @@ import javax.persistence.NoResultException; import javax.persistence.PersistenceException; import javax.persistence.Query; import org.mxchange.jcontacts.model.contact.Contact; -import org.mxchange.jcontacts.model.contact.ContactUtils; +import org.mxchange.jcontacts.model.contact.Contacts; import org.mxchange.jjobs.database.BaseJobsDatabaseBean; import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers; @@ -588,7 +588,7 @@ public class JobsUserSessionBean extends BaseJobsDatabaseBean implements UserSes final Contact managedContact = this.getEntityManager().merge(foundContact); // Copy all - ContactUtils.copyAll(user.getUserContact(), managedContact); + Contacts.copyAll(managedUser.getUserContact(), managedContact); // Set it back in user user.setUserContact(managedContact);