throw new NullPointerException("fetchedNumber.phoneId is null"); //NOI18N
}
- // Debug message
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getMobileId())); //NOI18N
-
- // Init query instance
- final DialableMobileNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getMobileId());
-
- // Debug message
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: foundNumber={0}", foundNumber)); //NOI18N
-
- // Default is null
- DialableMobileNumber detachedNumber = null;
-
- // Is there a difference?
- if (!MobileNumbers.isSameMobileNumber(mobileNumber, fetchedNumber)) {
- // @TODO Copy all to foundNumber, then merge
-
- // Merge this entry
- detachedNumber = this.getEntityManager().merge(foundNumber);
-
- // @TODO Copy all
- }
-
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
-
- // Return it
- return detachedNumber;
- }
-
- /**
- * Returns a detached instance from given land-line instance
- * <p>
- * @param landLineNumber Land-line instance
- * @param fetchedNumber Found land-line number in database
- * <p>
- * @return Detached instance
- */
- protected DialableLandLineNumber getDetached (final DialableLandLineNumber landLineNumber, final DialableLandLineNumber fetchedNumber) {
- // Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: landLineNumber={0},fetchedNumber={1} - CALLED!", landLineNumber, fetchedNumber)); //NOI18N
-
- // Should be valid
- if (null == landLineNumber) {
- // Throw NPE
- throw new NullPointerException("landLineNumber is null"); //NOI18N
- } else if (fetchedNumber.getPhoneId() == null) {
- // ..and again
- throw new NullPointerException("landLineNumber.phoneId is null"); //NOI18N
- }
-
- // Debug message
- this.getLoggerBeanLocal().logDebug(MessageFormat.format("getDetached: fetchedNumber.phoneId={0}", fetchedNumber.getPhoneId())); //NOI18N
-
// Init query instance
final DialableLandLineNumber foundNumber = this.getEntityManager().find(fetchedNumber.getClass(), fetchedNumber.getPhoneId());
// @TODO Copy all
}
+ // Set updated timestamp
+ managedBranchOffice.setBranchEntryUpdated(new Date());
+
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("getDetached: detachedNumber={0} - EXIT!", detachedNumber)); //NOI18N
throw new IllegalStateException(MessageFormat.format("{0}.detachedContact.contactId={1} is not valid.", this.getClass().getSimpleName(), detachedContact.getContactId())); //NOI18N
}
- // Set updated timestamp
- detachedContact.setContactEntryUpdated(new Date());
-
// Get contact from it and find it
final Contact foundContact = this.createManaged(detachedContact);
// Merge contact instance
final Contact managedContact = this.getEntityManager().merge(foundContact);
- // Copy all
- Contacts.copyAll(detachedContact, managedContact);
+ // Set updated timestamp
+ managedContact.setContactEntryUpdated(new Date());
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.mergeContactData: managedContact={1} - EXIT!", this.getClass().getSimpleName(), managedContact)); //NOI18N
throw new IllegalStateException(MessageFormat.format("detachedDepartment.departmentId ={0} is not valid.", detachedDepartment.getDepartmentId())); //NOI18N
}
- // Set updated timestamp
- detachedDepartment.setDepartmentEntryUpdated(new Date());
-
// Get contact from it and find it
final Department foundDepartment = this.createManaged(detachedDepartment);
// Merge contact instance
final Department managedDepartment = this.getEntityManager().merge(foundDepartment);
+ // Set updated timestamp
+ managedDepartment.setDepartmentEntryUpdated(new Date());
+
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("mergeDepartmentData: managedDepartment={0} - EXIT!", managedDepartment)); //NOI18N