@Override
public Contact findContactById (final Long contactId) throws ContactNotFoundException {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactById: contactId={0} - CALLED!", contactId)); //NOI18N
+
// The parameter must be valid
if (null == contactId) {
// Throw NPE
throw new ContactNotFoundException(contactId, ex);
}
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("findContactById: contact={0} - EXIT!", contact)); //NOI18N
+
// Return found instance
return contact;
}
*/
package org.mxchange.jphone.phonenumbers.mobileprovider;
+import java.text.MessageFormat;
import java.util.List;
import javax.ejb.Singleton;
import javax.ejb.Startup;
@Override
@SuppressWarnings ("unchecked")
public List<MobileProvider> allMobileProvider () {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace("allMobileProvider: CALLED!"); //NOI18N
+
// Init query
Query query = this.getEntityManager().createNamedQuery("AllMobileProvider", List.class); //NOI18N
+ // Get list
+ List<MobileProvider> list = query.getResultList();
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("allMobileProvider: list.size()={0} - EXIT!", list.size())); //NOI18N
+
// Return it
- return query.getResultList();
+ return list;
}
}
@Override
@SuppressWarnings ("unchecked")
public List<Contact> allContacts (final DialableCellphoneNumber cellPhone) {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("allContacts: cellPhone={0} - CALLED!", cellPhone)); //NOI18N
+
// The parameter should be valid
if (null == cellPhone) {
// Throw NPE
// No results found
}
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("allContacts: contacts={0} - EXIT!", contacts)); //NOI18N
+
// Return list
return contacts;
}
@Override
public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("findCellphoneById: cellphoneId={0} - CALLED!", cellphoneId)); //NOI18N
+
// The id number should be valid
if (null == cellphoneId) {
// Throw NPE
throw new PhoneEntityNotFoundException(cellphoneId, ex);
}
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("findCellphoneById: cellphone={0} - EXIT!", cellphone)); //NOI18N
+
// Return found instance
return cellphone;
}