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);
// 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());
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);
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);
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);
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);