From: Roland Häder Date: Fri, 23 Jun 2017 18:23:39 +0000 (+0200) Subject: Please cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=8b25c25d0d9346c583481e99db6abf3044534574;p=pizzaservice-ejb.git Please cherry-pick: - rewrote to new copyAll() methods as having them in POJOs is no good idea anyway as you should keep those objects as simple as possible. Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java index 9ec689d..b2c75b1 100644 --- a/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/contact/PizzaContactSessionBean.java @@ -23,7 +23,6 @@ import java.util.Objects; import javax.ejb.Stateless; import javax.persistence.NoResultException; import javax.persistence.Query; -import org.mxchange.jcontacts.contact.utils.ContactUtils; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; import org.mxchange.pizzaaplication.database.BasePizzaDatabaseBean; /** diff --git a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java index 8bee996..5bcd50a 100644 --- a/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/PizzaUserSessionBean.java @@ -29,6 +29,7 @@ import javax.persistence.NoResultException; import javax.persistence.PersistenceException; import javax.persistence.Query; import org.mxchange.jcontacts.contact.Contact; +import org.mxchange.jcontacts.contact.ContactUtils; import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber; import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber; import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber; @@ -584,7 +585,7 @@ public class PizzaUserSessionBean extends BasePizzaDatabaseBean implements UserS assert (updatedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Copy all data - updatedUser.copyAll(user); + UserUtils.copyAll(user, updatedUser); // Set as updated updatedUser.setUserUpdated(new GregorianCalendar()); @@ -713,7 +714,7 @@ public class PizzaUserSessionBean extends BasePizzaDatabaseBean implements UserS assert (updatedUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Copy all data - updatedUser.copyAll(user); + UserUtils.copyAll(user, updatedUser); // Set as updated updatedUser.setUserUpdated(new GregorianCalendar()); @@ -729,7 +730,7 @@ public class PizzaUserSessionBean extends BasePizzaDatabaseBean implements UserS this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: managedContact.contactId={0}", managedContact.getContactId())); //NOI18N // Copy all - managedContact.copyAll(user.getUserContact()); + ContactUtils.copyAll(user.getUserContact(), managedContact); // Set it back in user user.setUserContact(managedContact);