本文整理匯總了Java中javax.ejb.TransactionAttributeType.SUPPORTS屬性的典型用法代碼示例。如果您正苦於以下問題:Java TransactionAttributeType.SUPPORTS屬性的具體用法?Java TransactionAttributeType.SUPPORTS怎麽用?Java TransactionAttributeType.SUPPORTS使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類javax.ejb.TransactionAttributeType
的用法示例。
在下文中一共展示了TransactionAttributeType.SUPPORTS屬性的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testGetHandlerForBeanClassAndMethod1
@Test
public void testGetHandlerForBeanClassAndMethod1() throws Exception {
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
class Bean implements Runnable {
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void run() {
}
}
assertSame(TransactionInvocationHandlers.TX_MANDATORY,
TransactionInvocationHandlers.getHandlerFor(Bean.class,
Bean.class.getMethod("run")));
}
示例2: testGetHandlerForBeanClassAndMethod2
@Test
public void testGetHandlerForBeanClassAndMethod2() throws Exception {
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
class Bean implements Runnable {
public void run() {
}
}
assertSame(TransactionInvocationHandlers.TX_SUPPORTS,
TransactionInvocationHandlers.getHandlerFor(Bean.class,
Bean.class.getMethod("run")));
}
示例3: testGetHandlerForBeanClassAndMethod1
@Test
public void testGetHandlerForBeanClassAndMethod1() throws Exception {
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
class Bean implements Runnable {
@Override
@TransactionAttribute(TransactionAttributeType.MANDATORY)
public void run() {
}
}
assertSame(TransactionInvocationHandlers.TX_MANDATORY,
TransactionInvocationHandlers.getHandlerFor(Bean.class,
Bean.class.getMethod("run")));
}
示例4: testGetHandlerForBeanClassAndMethod2
@Test
public void testGetHandlerForBeanClassAndMethod2() throws Exception {
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
class Bean implements Runnable {
@Override
public void run() {
}
}
assertSame(TransactionInvocationHandlers.TX_SUPPORTS,
TransactionInvocationHandlers.getHandlerFor(Bean.class,
Bean.class.getMethod("run")));
}
示例5: createFooSupports
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooSupports(String name){
Foo foo = new Foo(name);
em.persist(foo);
}
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:5,代碼來源:EJB_07_MANDATORY.java
示例6: isPresentSupports
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentSupports(String name){
return em.find(Foo.class, name) != null;
}
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:4,代碼來源:EJB_07_MANDATORY.java
示例7: isPresentWithSupports
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentWithSupports(String name){
return em.find(Foo.class, name) != null;
}
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:4,代碼來源:EJB_04_SUPPORTS.java
示例8: createFooWithSupports
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooWithSupports(String name){
Foo foo = new Foo(name);
em.persist(foo);
}
開發者ID:arcuri82,項目名稱:testing_security_development_enterprise_systems,代碼行數:5,代碼來源:EJB_04_SUPPORTS.java
示例9: getAllBooks
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public Collection<Book> getAllBooks() {
return em.createQuery("FROM Book", Book.class).getResultList();
}