]> git.mxchange.org Git - pizzaservice-ejb.git/commitdiff
Returned finished customer number
authorRoland Häder <roland@mxchange.org>
Tue, 26 Apr 2016 07:44:34 +0000 (09:44 +0200)
committerRoland Haeder <roland@mxchange.org>
Wed, 27 Apr 2016 19:00:54 +0000 (21:00 +0200)
src/java/org/mxchange/pizzaapplication/model/customer/PizzaAdminCustomerSessionBean.java

index 6a9b845b80f1c7b9af024cfe17ab227f2ecc84f1..64f9db59c31656db8584862b126b72676548fe0a 100644 (file)
@@ -60,7 +60,7 @@ public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean impleme
        @Override
        public String createCustomerNumber () {
                // Init named query
-               Query query = this.getEntityManager().createNamedQuery("SearchCustomerByNumber", Customer.class);
+               Query query = this.getEntityManager().createNamedQuery("SearchCustomerByNumber", Customer.class); //NOI18N
 
                // Default is not found
                String customerNumber = null;
@@ -71,7 +71,7 @@ public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean impleme
                        String cn = CustomerUtils.generateCustomerNumber(PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_LENGTH, PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_BLOCK_SIZE, PizzaAdminCustomerSessionBeanRemote.CUSTOMER_NUMBER_SEPARATOR);
 
                        // Set the generated number as param
-                       query.setParameter("customerNumber", cn);
+                       query.setParameter("customerNumber", cn); //NOI18N
 
                        // Try to find it
                        try {
@@ -82,6 +82,9 @@ public class PizzaAdminCustomerSessionBean extends BasePizzaDatabaseBean impleme
                                customerNumber = cn;
                        }
                }
+
+               // Return generated number
+               return customerNumber;
        }
 
 }