+ @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;
+ }
+