import javax.persistence.Query;
import org.mxchange.jcoreee.database.BaseDatabaseBean;
import org.mxchange.jphone.exceptions.PhoneEntityNotFoundException;
-import org.mxchange.jphone.phonenumbers.cellphone.CellphoneNumber;
-import org.mxchange.jphone.phonenumbers.cellphone.DialableCellphoneNumber;
import org.mxchange.jphone.phonenumbers.fax.DialableFaxNumber;
import org.mxchange.jphone.phonenumbers.fax.FaxNumber;
import org.mxchange.jphone.phonenumbers.landline.DialableLandLineNumber;
import org.mxchange.jphone.phonenumbers.landline.LandLineNumber;
+import org.mxchange.jphone.phonenumbers.mobile.DialableMobileNumber;
+import org.mxchange.jphone.phonenumbers.mobile.MobileNumber;
/**
* A general phone EJB
@SuppressWarnings ("unchecked")
@Override
- public List<DialableCellphoneNumber> allCellphoneNumbers () {
+ public List<DialableMobileNumber> allMobileNumbers () {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allCellphoneNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
// Get query
- Query query = this.getEntityManager().createNamedQuery("AllCellphoneNumbers", CellphoneNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("AllCellphoneNumbers", MobileNumber.class); //NOI18N
// Get list from it
- List<DialableCellphoneNumber> list = query.getResultList();
+ List<DialableMobileNumber> list = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allCellphoneNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
// Return it
return list;
}
@Override
- public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
+ public DialableMobileNumber findMobileNumberById (final Long cellphoneId) throws PhoneEntityNotFoundException {
// Trace message
this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphoneId={1} - CALLED!", this.getClass().getSimpleName(), cellphoneId)); //NOI18N
}
// Now find it
- Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", CellphoneNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", MobileNumber.class); //NOI18N
// Set parameter
query.setParameter("cellphoneId", cellphoneId); //NOI18N
// Init instance
- DialableCellphoneNumber cellphone = null;
+ DialableMobileNumber cellphone = null;
// Try to get a result
try {
// Get a single result
- cellphone = (DialableCellphoneNumber) query.getSingleResult();
+ cellphone = (DialableMobileNumber) query.getSingleResult();
} catch (NoResultException ex) {
// The entry was not found, so throw it again
throw new PhoneEntityNotFoundException(cellphoneId, ex);