From: Roland Häder Date: Fri, 23 Jun 2017 20:15:29 +0000 (+0200) Subject: renamed to managedFoo X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7a70d710ee81813bcfbbc0818ded75988f66d831;p=jfinancials-ejb.git renamed to managedFoo Signed-off-by: Roland Häder --- diff --git a/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java b/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java index 9594d7e..84677fc 100644 --- a/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java +++ b/src/java/org/mxchange/jusercore/model/user/FinancialsUserSessionBean.java @@ -582,22 +582,22 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Merge user - User detachedUser = this.getEntityManager().merge(foundUser); + User managedUser = this.getEntityManager().merge(foundUser); // Should be found! - assert (detachedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", user.getUserId()); //NOI18N + assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", managedUser.getUserId()); //NOI18N // Copy all data - UserUtils.copyAll(user, detachedUser); + UserUtils.copyAll(managedUser, managedUser); // Set as updated - detachedUser.setUserUpdated(new GregorianCalendar()); + managedUser.setUserUpdated(new GregorianCalendar()); // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: detachedUser={1} - CALLED!", this.getClass().getSimpleName(), detachedUser)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserData: managedUser={1} - CALLED!", this.getClass().getSimpleName(), managedUser)); //NOI18N // Return updated instance - return detachedUser; + return managedUser; } @Override @@ -693,23 +693,23 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem assert (foundUser instanceof User) : MessageFormat.format("User with id {0} not found, but should be.", user.getUserId()); //NOI18N // Merge user - User detachedUser = this.getEntityManager().merge(foundUser); + User managedUser = this.getEntityManager().merge(foundUser); // Should be found! - assert (detachedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", user.getUserId()); //NOI18N + assert (managedUser instanceof User) : MessageFormat.format("User with id {0} not merged, but should be.", managedUser.getUserId()); //NOI18N // Copy all data - UserUtils.copyAll(user, detachedUser); + UserUtils.copyAll(managedUser, managedUser); // Set as updated - detachedUser.setUserUpdated(new GregorianCalendar()); - detachedUser.getUserContact().setContactUpdated(new GregorianCalendar()); + managedUser.setUserUpdated(new GregorianCalendar()); + managedUser.getUserContact().setContactUpdated(new GregorianCalendar()); // Get contact from it and find it - Contact foundContact = this.getEntityManager().find(user.getUserContact().getClass(), user.getUserContact().getContactId()); + Contact foundContact = this.getEntityManager().find(managedUser.getUserContact().getClass(), managedUser.getUserContact().getContactId()); // Should be found - assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", user.getUserContact().getContactId()); //NOI18N + assert (foundContact instanceof Contact) : MessageFormat.format("Contact with id {0} not found, but should be.", managedUser.getUserContact().getContactId()); //NOI18N // Debug message this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: contact.contactId={0}", foundContact.getContactId())); //NOI18N @@ -718,13 +718,13 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem Contact detachedContact = this.getEntityManager().merge(foundContact); // Copy all - ContactUtils.copyAll(user.getUserContact(), detachedContact); + ContactUtils.copyAll(managedUser.getUserContact(), detachedContact); // Set it back in user - user.setUserContact(detachedContact); + managedUser.setUserContact(detachedContact); // Should be found! - assert (detachedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not merged, but should be.", user.getUserContact().getContactId()); //NOI18N + assert (detachedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not merged, but should be.", managedUser.getUserContact().getContactId()); //NOI18N // Get mobile instance DialableMobileNumber mobileNumber = detachedContact.getContactMobileNumber(); @@ -747,7 +747,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem assert (detachedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", detachedMobile.getPhoneId()); //NOI18N // Copy all - detachedMobile.copyAll(user.getUserContact().getContactMobileNumber()); + detachedMobile.copyAll(managedUser.getUserContact().getContactMobileNumber()); // Set it back detachedContact.setContactMobileNumber(detachedMobile); @@ -774,7 +774,7 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem assert (detachedFax instanceof DialableFaxNumber) : MessageFormat.format("Fax number with id {0} not found but should be.", detachedFax.getPhoneId()); //NOI18N // Copy all - detachedFax.copyAll(user.getUserContact().getContactFaxNumber()); + detachedFax.copyAll(managedUser.getUserContact().getContactFaxNumber()); // Set it back detachedContact.setContactFaxNumber(detachedFax); @@ -801,17 +801,17 @@ public class FinancialsUserSessionBean extends BaseFinancialsDatabaseBean implem assert (detachedLandLine instanceof DialableLandLineNumber) : MessageFormat.format("Land line number with id {0} not found but should be.", detachedLandLine.getPhoneId()); //NOI18N // Copy all - detachedLandLine.copyAll(user.getUserContact().getContactLandLineNumber()); + detachedLandLine.copyAll(managedUser.getUserContact().getContactLandLineNumber()); // Set it back detachedContact.setContactLandLineNumber(detachedLandLine); } // Trace message - this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPersonalData: entry.detachedUser={1} - EXIT!", this.getClass().getSimpleName(), detachedUser)); //NOI18N + this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.updateUserPersonalData: entry.user={1} - EXIT!", this.getClass().getSimpleName(), managedUser)); //NOI18N // Return updated user instance - return detachedUser; + return managedUser; } }