]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Sat, 9 Sep 2017 12:49:54 +0000 (14:49 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 9 Sep 2017 15:49:12 +0000 (17:49 +0200)
- re-package season has started: now all core project's entity packages do
  always have following format: tld.domain.project.model.foo.SomeFoo;
- also fixed persistence unit

Signed-off-by: Roland Häder <roland@mxchange.org>
src/conf/persistence.xml
src/java/org/mxchange/jcontacts/model/contact/PizzaContactSessionBean.java
src/java/org/mxchange/jcontactsbusiness/model/branchoffice/PizzaAdminBranchOfficeSessionBean.java
src/java/org/mxchange/jphone/model/phonenumbers/phone/PizzaAdminPhoneSessionBean.java

index 9122a45d5be992e48f1304f3bbf91dddd2c06e79..ed0d8de43c7488d2b9527ebccb4251e4eccc38c0 100644 (file)
@@ -1,21 +1,22 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
   <persistence-unit name="pizzaservice-ejbPU" transaction-type="JTA">
-    <jta-data-source>jdbc/shop</jta-data-source>
-    <class>org.mxchange.jcontacts.contact.UserContact</class>
-    <class>org.mxchange.jcontactsbusiness.basicdata.CompanyBasicData</class>
-    <class>org.mxchange.jcontactsbusiness.branchoffice.CompanyBranchOffice</class>
-    <class>org.mxchange.jcontactsbusiness.department.CompanyDepartment</class>
-    <class>org.mxchange.jcontactsbusiness.employee.CompanyEmployee</class>
-    <class>org.mxchange.jcontactsbusiness.headquarters.CompanyHeadquartersData</class>
-    <class>org.mxchange.jcontactsbusiness.jobposition.EmployeePosition</class>
-    <class>org.mxchange.jcontactsbusiness.logo.CompanyLogo</class>
-    <class>org.mxchange.jcontactsbusiness.opening_times.BusinessOpeningTimes</class>
-    <class>org.mxchange.jcountry.data.CountryData</class>
-    <class>org.mxchange.jphone.phonenumbers.fax.FaxNumber</class>
-    <class>org.mxchange.jphone.phonenumbers.landline.LandLineNumber</class>
-    <class>org.mxchange.jphone.phonenumbers.mobile.MobileNumber</class>
-    <class>org.mxchange.jphone.phonenumbers.mobileprovider.CellphoneProvider</class>
+    <jta-data-source>jdbc/pizzaservice</jta-data-source>
+    <class>org.mxchange.jcontacts.model.contact.UserContact</class>
+    <class>org.mxchange.jcontactsbusiness.model.basicdata.CompanyBasicData</class>
+    <class>org.mxchange.jcontactsbusiness.model.branchoffice.CompanyBranchOffice</class>
+    <class>org.mxchange.jcontactsbusiness.model.department.CompanyDepartment</class>
+    <class>org.mxchange.jcontactsbusiness.model.employee.CompanyEmployee</class>
+    <class>org.mxchange.jcontactsbusiness.model.headquarters.CompanyHeadquartersData</class>
+    <class>org.mxchange.jcontactsbusiness.model.jobposition.EmployeePosition</class>
+    <class>org.mxchange.jcontactsbusiness.model.logo.CompanyLogo</class>
+    <class>org.mxchange.jcontactsbusiness.model.opening_times.BusinessOpeningTimes</class>
+    <class>org.mxchange.jcountry.model.data.CountryData</class>
+    <class>org.mxchange.jcustomercore.model.customer.ContactCustomer</class>
+    <class>org.mxchange.jphone.model.phonenumbers.fax.FaxNumber</class>
+    <class>org.mxchange.jphone.model.phonenumbers.landline.LandLineNumber</class>
+    <class>org.mxchange.jphone.model.phonenumbers.mobile.MobileNumber</class>
+    <class>org.mxchange.jphone.model.phonenumbers.mobileprovider.CellphoneProvider</class>
     <class>org.mxchange.jproduct.model.category.ProductCategory</class>
     <class>org.mxchange.jproduct.model.product.GenericProduct</class>
     <class>org.mxchange.jshopcore.model.basket.items.BasketItem</class>
@@ -25,7 +26,6 @@
     <class>org.mxchange.jusercore.model.user.LoginUser</class>
     <class>org.mxchange.jusercore.model.user.activity.UserActivityLog</class>
     <class>org.mxchange.jusercore.model.user.password_history.UserPasswordHistory</class>
-    <class>org.mxchange.jcustomercore.model.customer.ContactCustomer</class>
     <exclude-unlisted-classes>false</exclude-unlisted-classes>
     <properties>
       <property name="javax.persistence.schema-generation.database.action" value="create"/>
index 854f43aa969474b0bb8dcfaeba8e8dc41fde0fda..c4170aefbf68afbdf7339264c799d22b8edd3172 100644 (file)
@@ -247,9 +247,6 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co
                        // Get contact
                        Contact next = iterator.next();
 
-                       // Debug message
-                       this.getLoggerBeanLocal().logDebug(MessageFormat.format("lookupContact: next={0}", next)); //NOI18N
-
                        // Is same contact?
                        if ((Objects.equals(contact, next)) || (ContactUtils.isSameContact(contact, next))) {
                                // Debug message
@@ -264,14 +261,14 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co
                // Trace message
                this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.isContactFound: foundContact={1} - EXIT!", this.getClass().getSimpleName(), foundContact)); //NOI18N
 
-               // Return status
+               // Return found contact
                return foundContact;
        }
 
        @Override
-       public Contact updateContactData (final Contact contact, final boolean isMobileUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
+       public Contact updateContactData (final Contact contact, final boolean isCellphoneUnlinked, final boolean isLandlineUnlinked, final boolean isFaxUnlinked) {
                // Log trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: contact={1},isMobileUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED!", this.getClass().getSimpleName(), contact, isMobileUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: contact={1},isCellphoneUnlinked={2},isLandlineUnlinked={3},isFaxUnlinked={4} - CALLED!", this.getClass().getSimpleName(), contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked)); //NOI18N
 
                // The contact instance must be valid
                if (null == contact) {
@@ -285,14 +282,17 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co
                        throw new IllegalStateException(MessageFormat.format("contact.contactId={0} is not valid.", contact.getContactId())); //NOI18N
                }
 
-               // Merge cellphone, land-line and fix
-               Contact managedContact = this.mergeContactData(contact);
+               // Set updated timestamp
+               this.setAllContactPhoneEntriesUpdated(contact, isCellphoneUnlinked, isLandlineUnlinked, isFaxUnlinked);
+
+               // Merge mobile, land-line and fix
+               Contact detachedContact = this.mergeContactData(contact);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
 
                // Return it
-               return managedContact;
+               return detachedContact;
        }
 
        @Override
@@ -313,18 +313,18 @@ public class PizzaContactSessionBean extends BasePizzaDatabaseBean implements Co
                }
 
                // Is cell phone/land-line/fax number unlinked?
-               boolean isMobileUnlinked = (contact.getContactMobileNumber() == null);
+               boolean isCellphoneUnlinked = (contact.getContactMobileNumber() == null);
                boolean isLandLineUnlinked = (contact.getContactLandLineNumber() == null);
                boolean isFaxUnlinked = (contact.getContactFaxNumber() == null);
 
                // Call other Method
-               Contact managedContact = this.updateContactData(contact, isMobileUnlinked, isLandLineUnlinked, isFaxUnlinked);
+               Contact detachedContact = this.updateContactData(contact, isCellphoneUnlinked, isLandLineUnlinked, isFaxUnlinked);
 
                // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateContactData: detachedContact={1} - EXIT!", this.getClass().getSimpleName(), detachedContact)); //NOI18N
 
                // Return it
-               return managedContact;
+               return detachedContact;
        }
 
 }
index 1bd1cac51840d3fcbdca2ddac49293df67f023d5..001fba6185f77685af66efb13512802c262a0e82 100644 (file)
@@ -25,8 +25,6 @@ import org.mxchange.jcontactsbusiness.branchoffice.AdminBranchOfficeSessionBeanR
 import org.mxchange.jcontactsbusiness.branchoffice.BranchOfficeSessionBeanRemote;
 import org.mxchange.jcontactsbusiness.exceptions.branchoffice.BranchOfficeAlreadyAddedException;
 import org.mxchange.jcontactsbusiness.model.basicdata.BusinessBasicData;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOffice;
-import org.mxchange.jcontactsbusiness.model.branchoffice.BranchOfficeUtils;
 import org.mxchange.jcountry.model.data.Country;
 import org.mxchange.jusercore.model.user.User;
 import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;
index 360720cec34891c580e4e6f20d3cdb2e49ca0d75..de0958e823bc0433d13fbdb20d3cac39cf13ed47 100644 (file)
@@ -25,7 +25,6 @@ import org.mxchange.jphone.model.phonenumbers.landline.DialableLandLineNumber;
 import org.mxchange.jphone.model.phonenumbers.landline.LandLineNumbers;
 import org.mxchange.jphone.model.phonenumbers.mobile.DialableMobileNumber;
 import org.mxchange.jphone.model.phonenumbers.mobile.MobileNumbers;
-import org.mxchange.jphone.model.phonenumbers.phone.AdminPhoneSessionBeanRemote;
 import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean;
 
 /**