]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Please cherry-pick:
authorRoland Häder <roland@mxchange.org>
Mon, 15 Aug 2016 12:23:13 +0000 (14:23 +0200)
committerRoland Haeder <roland@mxchange.org>
Tue, 16 Aug 2016 18:08:00 +0000 (20:08 +0200)
- sorted members

Signed-off-by: Roland Häder <roland@mxchange.org>
src/java/org/mxchange/jphone/phonenumbers/phone/PizzaPhoneSessionBean.java

index cdb58d063361b406ecb2b3a0262c36c87045b2ca..698e67dd763a9db39fec5eea0992c47e614c1b26 100644 (file)
@@ -48,45 +48,6 @@ public class PizzaPhoneSessionBean extends BasePizzaDatabaseBean implements Phon
        public PizzaPhoneSessionBean () {
        }
 
-       @Override
-       public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphoneId={1} - CALLED!", this.getClass().getSimpleName(), cellphoneId)); //NOI18N
-
-               // The id number should be valid
-               if (null == cellphoneId) {
-                       // Throw NPE
-                       throw new NullPointerException("cellphoneId is null"); //NOI18N
-               } else if (cellphoneId < 1) {
-                       // Not valid
-                       throw new IllegalArgumentException(MessageFormat.format("cellphoneId={0} is not valid.", cellphoneId)); //NOI18N
-               }
-
-               // Now find it
-               Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", DialableCellphoneNumber.class); //NOI18N
-
-               // Set parameter
-               query.setParameter("cellphoneId", cellphoneId); //NOI18N
-
-               // Init instance
-               DialableCellphoneNumber cellphone = null;
-
-               // Try to get a result
-               try {
-                       // Get a single result
-                       cellphone = (DialableCellphoneNumber) query.getSingleResult();
-               } catch (NoResultException ex) {
-                       // The entry was not found, so throw it again
-                       throw new PhoneEntityNotFoundException(cellphoneId, ex);
-               }
-
-               // Trace message
-               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), cellphone)); //NOI18N
-
-               // Return found instance
-               return cellphone;
-       }
-
        @SuppressWarnings ("unchecked")
        @Override
        public List<DialableCellphoneNumber> allCellphoneNumbers () {
@@ -144,4 +105,43 @@ public class PizzaPhoneSessionBean extends BasePizzaDatabaseBean implements Phon
                return list;
        }
 
+       @Override
+       public DialableCellphoneNumber findCellphoneById (final Long cellphoneId) throws PhoneEntityNotFoundException {
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphoneId={1} - CALLED!", this.getClass().getSimpleName(), cellphoneId)); //NOI18N
+
+               // The id number should be valid
+               if (null == cellphoneId) {
+                       // Throw NPE
+                       throw new NullPointerException("cellphoneId is null"); //NOI18N
+               } else if (cellphoneId < 1) {
+                       // Not valid
+                       throw new IllegalArgumentException(MessageFormat.format("cellphoneId={0} is not valid.", cellphoneId)); //NOI18N
+               }
+
+               // Now find it
+               Query query = this.getEntityManager().createNamedQuery("SearchCellphoneId", CellphoneNumber.class); //NOI18N
+
+               // Set parameter
+               query.setParameter("cellphoneId", cellphoneId); //NOI18N
+
+               // Init instance
+               DialableCellphoneNumber cellphone = null;
+
+               // Try to get a result
+               try {
+                       // Get a single result
+                       cellphone = (DialableCellphoneNumber) query.getSingleResult();
+               } catch (NoResultException ex) {
+                       // The entry was not found, so throw it again
+                       throw new PhoneEntityNotFoundException(cellphoneId, ex);
+               }
+
+               // Trace message
+               this.getLoggerBeanLocal().logTrace(MessageFormat.format("{0}.findCellphoneById: cellphone={1} - EXIT!", this.getClass().getSimpleName(), cellphone)); //NOI18N
+
+               // Return found instance
+               return cellphone;
+       }
+
 }