OrderCustomer mergedOrSavedOrderCustomer = null;
try {
Session session = (Session) em.getDelegate();
String hql = "FROM OrderNumber";
Query query = session.createQuery(hql);
OrderNumber orderNumber = (OrderNumber) query.uniqueResult();
Integer previousLastOrderNumber = orderNumber.getLastOrderNumber();
Integer newLastOrderNumber = new Integer(previousLastOrderNumber.intValue() + 1);
orderCustomer.setPrefixHashFolder(UUID.randomUUID().toString());
orderCustomer.setOrderNum("" + newLastOrderNumber);