]> git.mxchange.org Git - pizzaservice-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>
Mon, 15 Jul 2019 05:13:58 +0000 (07:13 +0200)
- 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/PizzaContactSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/employee/PizzaAdminEmployeeSessionBean.java
src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java
src/java/org/mxchange/pizzaapplication/enterprise/BasePizzaEnterpriseBean.java

index ac0c522cd05dd6451c42752cc25a3c20af69ee11..ae96a0223f777c9c0f98057b19d123548b5bfa6d 100644 (file)
@@ -106,7 +106,7 @@ public class PizzaContactSessionBean extends BasePizzaEnterpriseBean implements
                        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 7eecf34dffb19bc5b94c70176f5adaf53125c2ee..b87d8235f724870d8392a93413e9e2e538cd9d72 100644 (file)
@@ -69,15 +69,15 @@ public class PizzaAdminEmployeeSessionBean extends BasePizzaEnterpriseBean imple
                } 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 PizzaAdminEmployeeSessionBean extends BasePizzaEnterpriseBean imple
                } 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 PizzaAdminEmployeeSessionBean extends BasePizzaEnterpriseBean imple
                }
 
                // 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 PizzaAdminEmployeeSessionBean extends BasePizzaEnterpriseBean imple
                }
 
                // 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 64d36595193f00da0e7687ec820d5d0bae89afdf..54260d3e68796ec57e4f663773999d494a969c7b 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.jphone.model.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.model.phonenumbers.fax.FaxNumbers;
 import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
@@ -588,7 +588,7 @@ public class PizzaUserSessionBean extends BasePizzaEnterpriseBean implements Use
                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);
index e6a2b9c2858f9d409127b5fab82a37f081c34dd2..aa0472fab851003c92966e267798a58334e61ada 100644 (file)
@@ -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;
@@ -476,37 +475,37 @@ public abstract class BasePizzaEnterpriseBean extends BaseEnterpriseBean {
        /**
         * Get back a managed instance from given headquarters
         * <p>
-        * @param headquarters Unmanaged/detached headquarters instance
+        * @param headquarter Unmanaged/detached headquarter instance
         * <p>
         * @return Managed basic data instance
         */
-       protected Headquarter createManaged (final Headquarter headquarters) {
+       protected Headquarter createManaged (final Headquarter headquarter) {
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarters)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: headquarter={1} - CALLED!", this.getClass().getSimpleName(), headquarter)); //NOI18N
 
                // user should not be null
-               if (null == headquarters) {
+               if (null == headquarter) {
                        // Abort here
                        throw new NullPointerException("headquarter is null"); //NOI18N
-               } else if (headquarters.getHeadquartersId() == null) {
+               } else if (headquarter.getHeadquartersId() == null) {
                        // Id is set
-                       throw new NullPointerException("headquarter.headquartersId is null"); //NOI18N
-               } else if (headquarters.getHeadquartersId() < 1) {
+                       throw new NullPointerException("headquarter.headquarterId is null"); //NOI18N
+               } else if (headquarter.getHeadquartersId() < 1) {
                        // Id is set
-                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquartersId={0} is invalid", headquarters.getHeadquartersId())); //NOI18N
+                       throw new IllegalArgumentException(MessageFormat.format("headquarter.headquarterId={0} is invalid", headquarter.getHeadquartersId())); //NOI18N
                }
 
                // Try to find it (should be there)
-               final Headquarter managedHeadquarters = this.getEntityManager().find(BusinessHeadquarters.class, headquarters.getHeadquartersId());
+               final Headquarter managedHeadquarter = this.getEntityManager().find(BusinessHeadquarters.class, headquarter.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
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.createManaged: managedHeadquarter={1} - EXIT!", this.getClass().getSimpleName(), managedHeadquarter)); //NOI18N
 
                // Return it
-               return managedHeadquarters;
+               return managedHeadquarter;
        }
 
        /**
@@ -991,7 +990,7 @@ public abstract class BasePizzaEnterpriseBean 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("{0}.mergeContactData: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N