]> git.mxchange.org Git - jfinancials-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Fri, 23 Jun 2017 18:23:39 +0000 (20:23 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 23 Jun 2017 18:23:39 +0000 (20:23 +0200)
- 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 <roland@mxchange.org>
src/java/org/mxchange/jcontacts/contact/FinancialsContactSessionBean.java
src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java

index a0975b5cd4219552b59e0742c9a3f4d6a2972ebc..72f618d3e34881e38ce9829c9293ea946a3f222b 100644 (file)
@@ -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.jfinancials.database.BaseFinancialsDatabaseBean;
 
index 2da8f207cfeb9e739f598cadad33f2fd196138a0..9594d7ec531ad4cd063b854287367ac9617a5db4 100644 (file)
@@ -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.jfinancials.database.BaseFinancialsDatabaseBean;
 import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
 import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
@@ -587,7 +588,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
                assert (detachedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", user.getUserId()); //NOI18N
 
                // Copy all data
-               detachedUser.copyAll(user);
+               UserUtils.copyAll(user, detachedUser);
 
                // Set as updated
                detachedUser.setUserUpdated(new GregorianCalendar());
@@ -698,7 +699,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
                assert (detachedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", user.getUserId()); //NOI18N
 
                // Copy all data
-               detachedUser.copyAll(user);
+               UserUtils.copyAll(user, detachedUser);
 
                // Set as updated
                detachedUser.setUserUpdated(new GregorianCalendar());
@@ -717,7 +718,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem
                Contact detachedContact = this.getEntityManager().merge(foundContact);
 
                // Copy all
-               detachedContact.copyAll(user.getUserContact());
+               ContactUtils.copyAll(user.getUserContact(), detachedContact);
 
                // Set it back in user
                user.setUserContact(detachedContact);