use of org.jboss.as.quickstarts.cmt.model.Customer in project quickstart by wildfly.
the class CustomerManagerEJB method createCustomer.
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void createCustomer(String name) throws RemoteException, JMSException {
logMessageManager.logCreateCustomer(name);
Customer c1 = new Customer();
c1.setName(name);
entityManager.persist(c1);
invoiceManager.createInvoice(name);
// after the fact but before the transaction is committed.
if (!nameIsValid(name)) {
throw new EJBException("Invalid name: customer names should only contain letters & '-'");
}
}
use of org.jboss.as.quickstarts.cmt.model.Customer in project quickstart by wildfly.
the class CustomerManagerEJB method createCustomer.
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public void createCustomer(String name) throws RemoteException, JMSException {
Customer c1 = new Customer();
c1.setName(name);
entityManager.persist(c1);
final InvoiceManagerEJB invoiceManager = invoiceManagerHome.create();
invoiceManager.createInvoice(name);
}
Aggregations