<?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>
<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"/>
// 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
// 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) {
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
}
// 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;
}
}
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;
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;
/**