@Stateless public class MyService { @PersistenceContext private EntityManager entityManager; @TransactionAttribute(TransactionAttributeType.REQUIRED) public void performBusinessLogic() { // ... MyEntity entity = new MyEntity(); entityManager.persist(entity); // ... } }


上一篇:
下一篇:
切换中文