import javax.persistence.Query;
import org.mxchange.addressbook.database.BaseAddressbookDatabaseBean;
import org.mxchange.jcontacts.contact.Contact;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
import org.mxchange.jusercore.exceptions.UserNotFoundException;
import org.mxchange.jusercore.exceptions.UserStatusConfirmedException;
import org.mxchange.jusercore.exceptions.UserStatusLockedException;
// Should be found!
assert (detachedContact instanceof Contact) : MessageFormat.format("Contact with id {0} not merged, but should be.", user.getUserContact().getContactId()); //NOI18N
- // Get cellphone instance
- DialableCellphoneNumber cellphone = detachedContact.getContactCellphoneNumber();
+ // Get mobile instance
+ DialableMobileNumber mobileNumber = detachedContact.getContactMobileNumber();
- // Is there a cellphone instance set?
- if (cellphone instanceof DialableCellphoneNumber) {
+ // Is there a mobile instance set?
+ if (mobileNumber instanceof DialableMobileNumber) {
// Debug message
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: cellphone.phoneId={0} is being updated ...", cellphone.getPhoneId())); //NOI18N
+ this.getLoggerBeanLocal().logDebug(MessageFormat.format("updateUserPersonalData: mobile.phoneId={0} is being updated ...", mobileNumber.getPhoneId())); //NOI18N
// Then find it, too
- DialableCellphoneNumber foundCellphone = this.getEntityManager().find(cellphone.getClass(), cellphone.getPhoneId());
+ DialableMobileNumber foundMobile = this.getEntityManager().find(mobileNumber.getClass(), mobileNumber.getPhoneId());
// Should be there
- assert (foundCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", foundCellphone.getPhoneId()); //NOI18N
+ assert (foundMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", foundMobile.getPhoneId()); //NOI18N
// Then merge it, too
- DialableCellphoneNumber detachedCellphone = this.getEntityManager().merge(foundCellphone);
+ DialableMobileNumber detachedMobile = this.getEntityManager().merge(foundMobile);
// Should be there
- assert (detachedCellphone instanceof DialableCellphoneNumber) : MessageFormat.format("Cellphone number with id {0} not found but should be.", detachedCellphone.getPhoneId()); //NOI18N
+ assert (detachedMobile instanceof DialableMobileNumber) : MessageFormat.format("Mobile number with id {0} not found but should be.", detachedMobile.getPhoneId()); //NOI18N
// Copy all
- detachedCellphone.copyAll(user.getUserContact().getContactCellphoneNumber());
+ detachedMobile.copyAll(user.getUserContact().getContactMobileNumber());
// Set it back
- detachedContact.setContactCellphoneNumber(detachedCellphone);
+ detachedContact.setContactMobileNumber(detachedMobile);
}
- // Get cellphone instance
+ // Get mobile instance
DialableFaxNumber fax = detachedContact.getContactFaxNumber();
// Is there a fax instance set?
detachedContact.setContactFaxNumber(detachedFax);
}
- // Get cellphone instance
+ // Get mobile instance
DialableLandLineNumber landLine = detachedContact.getContactLandLineNumber();
// Is there a fax instance set?