@SuppressWarnings ("unchecked")
@Override
- public List<DialableMobileNumber> allMobileNumbers () {
+ public List<DialableFaxNumber> allFaxNumbers () {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allFaxNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
// Get query
- Query query = this.getEntityManager().createNamedQuery("AllCellphoneNumbers", MobileNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("AllFaxNumbers", FaxNumber.class); //NOI18N
// Get list from it
- List<DialableMobileNumber> list = query.getResultList();
+ List<DialableFaxNumber> list = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allFaxNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
// Return it
return list;
@SuppressWarnings ("unchecked")
@Override
- public List<DialableFaxNumber> allFaxNumbers () {
+ public List<DialableLandLineNumber> allLandLineNumbers () {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allFaxNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allLandLineNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
// Get query
- Query query = this.getEntityManager().createNamedQuery("AllFaxNumbers", FaxNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("AllLandLineNumbers", LandLineNumber.class); //NOI18N
// Get list from it
- List<DialableFaxNumber> list = query.getResultList();
+ List<DialableLandLineNumber> list = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allFaxNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allLandLineNumbers: list.size()={1} - EXIT!", this.getClass().getSimpleName(), list.size())); //NOI18N
// Return it
return list;
@SuppressWarnings ("unchecked")
@Override
- public List<DialableLandLineNumber> allLandLineNumbers () {
+ public List<DialableMobileNumber> allMobileNumbers () {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allLandLineNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allMobileNumbers: CALLED!", this.getClass().getSimpleName())); //NOI18N
// Get query
- Query query = this.getEntityManager().createNamedQuery("AllLandLineNumbers", LandLineNumber.class); //NOI18N
+ Query query = this.getEntityManager().createNamedQuery("AllMobileNumbers", MobileNumber.class); //NOI18N
// Get list from it
- List<DialableLandLineNumber> list = query.getResultList();
+ List<DialableMobileNumber> list = query.getResultList();
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.allLandLineNumbers: 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 DialableFaxNumber findFaxNumberById (final Long faxNumberId) throws PhoneEntityNotFoundException {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findFaxNumberById: mobileNumberId={1} - CALLED!", this.getClass().getSimpleName(), faxNumberId)); //NOI18N
+
+ // The id number should be valid
+ if (null == faxNumberId) {
+ // Throw NPE
+ throw new NullPointerException("faxNumberId is null"); //NOI18N
+ } else if (faxNumberId < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("faxNumberId={0} is not valid.", faxNumberId)); //NOI18N
+ }
+
+ // Now find it
+ Query query = this.getEntityManager().createNamedQuery("SearchFaxNumberId", FaxNumber.class); //NOI18N
+
+ // Set parameter
+ query.setParameter("faxNumberId", faxNumberId); //NOI18N
+
+ // Init instance
+ DialableFaxNumber faxNumber = null;
+
+ // Try to get a result
+ try {
+ // Get a single result
+ faxNumber = (DialableFaxNumber) query.getSingleResult();
+ } catch (NoResultException ex) {
+ // The entry was not found, so throw it again
+ throw new PhoneEntityNotFoundException(faxNumberId, ex);
+ }
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findFaxNumberById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), faxNumber)); //NOI18N
+
+ // Return found instance
+ return faxNumber;
+ }
+
+ @Override
+ public DialableLandLineNumber findLandLineNumberById (final Long landLineNumberId) throws PhoneEntityNotFoundException {
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findLandLineNumberById: mobileNumberId={1} - CALLED!", this.getClass().getSimpleName(), landLineNumberId)); //NOI18N
+
+ // The id number should be valid
+ if (null == landLineNumberId) {
+ // Throw NPE
+ throw new NullPointerException("landLineNumberId is null"); //NOI18N
+ } else if (landLineNumberId < 1) {
+ // Not valid
+ throw new IllegalArgumentException(MessageFormat.format("landLineNumberId={0} is not valid.", landLineNumberId)); //NOI18N
+ }
+
+ // Now find it
+ Query query = this.getEntityManager().createNamedQuery("SearchLandLineNumberId", LandLineNumber.class); //NOI18N
+
+ // Set parameter
+ query.setParameter("landLineNumberId", landLineNumberId); //NOI18N
+
+ // Init instance
+ DialableLandLineNumber landLineNumber = null;
+
+ // Try to get a result
+ try {
+ // Get a single result
+ landLineNumber = (DialableLandLineNumber) query.getSingleResult();
+ } catch (NoResultException ex) {
+ // The entry was not found, so throw it again
+ throw new PhoneEntityNotFoundException(landLineNumberId, ex);
+ }
+
+ // Trace message
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findLandLineNumberById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), landLineNumber)); //NOI18N
+
+ // Return found instance
+ return landLineNumber;
+ }
+
@Override
public DialableMobileNumber findMobileNumberById (final Long mobileNumberId) throws PhoneEntityNotFoundException {
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: mobileNumberId={1} - CALLED!", this.getClass().getSimpleName(), mobileNumberId)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findMobileNumberById: mobileNumberId={1} - CALLED!", this.getClass().getSimpleName(), mobileNumberId)); //NOI18N
// The id number should be valid
if (null == mobileNumberId) {
}
// Trace message
- this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), cellphone)); //NOI18N
+ this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findMobileNumberById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), cellphone)); //NOI18N
// Return found instance
return cellphone;