本文整理汇总了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();
}