Counter counter = null; try { counter = manager.find(Counter.class, name); if (counter == null) { counter = new Counter(name); manager.persist(counter); } } catch (Exception e) { e.printStackTrace(); throw new EJBException(e); } return counter;
ejb.interface-method return getCounter(idPrefix).nextValue();
return getCounter(idPrefix).nextValue();