]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sun, 18 Mar 2018 21:25:50 +0000 (22:25 +0100)
committerRoland Häder <roland@mxchange.org>
Sun, 18 Mar 2018 21:25:50 +0000 (22:25 +0100)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jcontacts/model/contact/FinancialsContactSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/FinancialsAdminEmployeeSessionBean.java
src/java/org/mxchange/jfinancials/database/BaseFinancialsDatabaseBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java

index a2db3210a5e712aab94d51d2d80fcf1a868b2eec..74509e6c0429061355cb564efc7ca66c4952e4ef 100644 (file)
@@ -107,7 +107,7 @@ public class FinancialsContactSessionBean extends BaseFinancialsDatabaseBean imp
                        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
 
index ef164210bb580b6d85d6ef6ab9d97c3d0678bffd..26f23facf829ed89d8d5471ed322bd37c4e28bac 100644 (file)
@@ -69,15 +69,15 @@ public class FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
                } 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 FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
                } 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 FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
                }
 
                // 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 FinancialsAdminEmployeeSessionBean extends BaseFinancialsDatabaseBe
                }
 
                // 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?
index f2faacdfaa914abd8868778e39857cee2731ea82..9b303f658ae4326f901a99abb2904ced7d11039d 100644 (file)
@@ -28,7 +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.Contacts;
 import org.mxchange.jcontactsbusiness.model.basicdata.BasicData;
 import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
 import org.mxchange.jcontactsbusiness.model.department.Department;
@@ -326,7 +326,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseEnterpriseBean {
                final Headquarter managedHeadquarter = this.getEntityManager().find(headquarter.getClass(), headquarter.getHeadquarterId());
 
                // Should be there
-               assert (managedHeadquarter instanceof BasicData) : "managedHeadquarter is null"; //NOI18N
+               assert (managedHeadquarter instanceof Headquarter) : "managedHeadquarter is null"; //NOI18N
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarter={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarter)); //NOI18N
@@ -916,7 +916,7 @@ public abstract class BaseFinancialsDatabaseBean extends BaseEnterpriseBean {
                final Contact managedContact = this.getEntityManager().merge(foundContact);
 
                // Copy all
-               ContactUtils.copyAll(detachedContact, managedContact);
+               Contacts.copyAll(detachedContact, managedContact);
 
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeContactData: detachedContact={0} - EXIT!", managedContact)); //NOI18N
index fa471e016d5cda36bcbe2c41943575af0610a5d7..95e0fb4d786d767131414ebcc4cb3905b65c43c3 100644 (file)
@@ -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.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
@@ -585,7 +585,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
                final Contact managedContact = this.getEntityManager().merge(foundContact);
 
                // Copy all
-               ContactUtils.copyAll(managedUser.getUserContact(), managedContact);
+               Contacts.copyAll(managedUser.getUserContact(), managedContact);
 
                // Set it back in user
                managedUser.setUserContact(managedContact);