From: Roland Häder Date: Sat, 18 Apr 2020 14:58:26 +0000 (+0200) Subject: Don't cherry-pick: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=89d93ae794323cd4cce25ab66077bed49fb40cde;p=addressbook-ejb.git Don't cherry-pick: - fixed some method calls/variable names Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jcontacts/model/contact/AddressbookAdminContactSessionBean.java b/src/java/org/mxchange/jcontacts/model/contact/AddressbookAdminContactSessionBean.java index 80f9255..41afe1a 100644 --- a/src/java/org/mxchange/jcontacts/model/contact/AddressbookAdminContactSessionBean.java +++ b/src/java/org/mxchange/jcontacts/model/contact/AddressbookAdminContactSessionBean.java @@ -21,6 +21,7 @@ import java.util.Date; import java.util.Objects; import javax.ejb.EJB; import javax.ejb.Stateless; +import org.mxchange.addressbook.enterprise.BaseAddressbookEnterpriseBean; import org.mxchange.jcontacts.exceptions.ContactAlreadyAddedException; import org.mxchange.jcontacts.exceptions.ContactNotFoundException; diff --git a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java index 7ffc1c1..4eed341 100644 --- a/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/AddressbookUserSessionBean.java @@ -285,10 +285,10 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im final User foundUser = this.getEntityManager().find(user.getClass(), user.getUserId()); // Should be found! - assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", detachedUser.getUserId()); //NOI18N + assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Copy all data - Users.copyUserData(detachedUser, foundUser); + Users.copyUserData(user, foundUser); // Merge user final User managedUser = this.getEntityManager().merge(foundUser); @@ -416,7 +416,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im // Set as updated managedUser.setUserUpdated(new Date()); - managedUser.getUserContact().setContactUpdated(new Date()); + managedUser.getUserContact().setContactEntryUpdated(new Date()); // Get contact from it and find it final Contact foundContact = this.getEntityManager().find(managedUser.getUserContact().getClass(), managedUser.getUserContact().getContactId()); @@ -431,7 +431,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im final Contact managedContact = this.getEntityManager().merge(foundContact); // Copy all - Contacts.copyAll(managedUser.getUserContact(), managedContact); + Contacts.copyContactData(managedUser.getUserContact(), managedContact); // Set it back in user managedUser.setUserContact(managedContact); @@ -463,7 +463,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im assert (managedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", managedMobile.getMobileId()); //NOI18N // Copy all - MobileNumbers.copyAll(managedUser.getUserContact().getContactMobileNumber(), managedMobile); + MobileNumbers.copyMobileNumberData(managedUser.getUserContact().getContactMobileNumber(), managedMobile); // Set it back managedContact.setContactMobileNumber(managedMobile); @@ -493,7 +493,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im assert (managedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", managedFax.getPhoneId()); //NOI18N // Copy all - FaxNumbers.copyAll(managedUser.getUserContact().getContactFaxNumber(), managedFax); + FaxNumbers.copyFaxNumberData(managedUser.getUserContact().getContactFaxNumber(), managedFax); // Set it back managedContact.setContactFaxNumber(managedFax); @@ -523,7 +523,7 @@ public class AddressbookUserSessionBean extends BaseAddressbookEnterpriseBean im assert (managedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", managedLandLine.getPhoneId()); //NOI18N // Copy all - LandLineNumbers.copyAll(managedUser.getUserContact().getContactLandLineNumber(), managedLandLine); + LandLineNumbers.copyLandLineNumberData(managedUser.getUserContact().getContactLandLineNumber(), managedLandLine); // Set it back managedContact.setContactLandLineNumber(managedLandLine);