@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;
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 {
customerNumber = cn;
}
}
+
+ // Return generated number
+ return customerNumber;
}
}