Java Code Examples for javax.ejb.TransactionAttributeType#SUPPORTS

The following examples show how to use javax.ejb.TransactionAttributeType#SUPPORTS . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TransactionInvocationHandlersTest.java    From development with Apache License 2.0 5 votes vote down vote up
@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")));
}
 
Example 2
Source File: TransactionInvocationHandlersTest.java    From development with Apache License 2.0 5 votes vote down vote up
@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")));
}
 
Example 3
Source File: BoostrapUtility.java    From tomee with Apache License 2.0 5 votes vote down vote up
@PostConstruct
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void initDatabase() {
    em1.find(Person.class, 0);
    em2.find(Person.class, 0);
    em3.find(Person.class, 0);
}
 
Example 4
Source File: EJB_04_SUPPORTS.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentWithSupports(String name){
    return em.find(Foo.class, name) != null;
}
 
Example 5
Source File: Movies.java    From tomee with Apache License 2.0 4 votes vote down vote up
@PermitAll
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public List<Movie> getMovies() throws Exception {
    Query query = entityManager.createQuery("SELECT m from Movie as m");
    return query.getResultList();
}
 
Example 6
Source File: Movies.java    From tomee with Apache License 2.0 4 votes vote down vote up
@PermitAll
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public List<Movie> getMovies() throws Exception {
    Query query = entityManager.createQuery("SELECT m from Movie as m");
    return query.getResultList();
}
 
Example 7
Source File: EmployeeDAOBean.java    From training with MIT License 4 votes vote down vote up
@Override
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public Employee getById(String id) {
	return em.find(Employee.class, id);
}
 
Example 8
Source File: Movies.java    From tomee with Apache License 2.0 4 votes vote down vote up
@PermitAll
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public List<Movie> getMovies() throws Exception {
    Query query = entityManager.createQuery("SELECT m from Movie as m");
    return query.getResultList();
}
 
Example 9
Source File: EJB_08_NOT_SUPPORTED.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooSupports(String name){
    Foo foo = new Foo(name);
    em.persist(foo);
}
 
Example 10
Source File: EJB_04_SUPPORTS.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooWithSupports(String name){
    Foo foo = new Foo(name);
    em.persist(foo);
}
 
Example 11
Source File: Movies.java    From tomee with Apache License 2.0 4 votes vote down vote up
@PermitAll
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public List<Movie> getMovies() throws Exception {
    Query query = entityManager.createQuery("SELECT m from Movie as m");
    return query.getResultList();
}
 
Example 12
Source File: EJB_07_MANDATORY.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentSupports(String name){
    return em.find(Foo.class, name) != null;
}
 
Example 13
Source File: EJB_07_MANDATORY.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooSupports(String name){
    Foo foo = new Foo(name);
    em.persist(foo);
}
 
Example 14
Source File: AnnotationTransactionAttributeSourceTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
@javax.ejb.TransactionAttribute(TransactionAttributeType.SUPPORTS)
public String getName() {
	return name;
}
 
Example 15
Source File: DynamicDataSourceTest.java    From tomee with Apache License 2.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void initDatabase() {
    em1.find(Person.class, 0);
    em2.find(Person.class, 0);
    em3.find(Person.class, 0);
}
 
Example 16
Source File: EJB_04_SUPPORTS.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooWithSupports(String name){
    Foo foo = new Foo(name);
    em.persist(foo);
}
 
Example 17
Source File: EJB_04_SUPPORTS.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentWithSupports(String name){
    return em.find(Foo.class, name) != null;
}
 
Example 18
Source File: EJB_07_MANDATORY.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public boolean isPresentSupports(String name){
    return em.find(Foo.class, name) != null;
}
 
Example 19
Source File: EJB_07_MANDATORY.java    From testing_security_development_enterprise_systems with GNU Lesser General Public License v3.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public void createFooSupports(String name){
    Foo foo = new Foo(name);
    em.persist(foo);
}
 
Example 20
Source File: PersonManager.java    From tomee with Apache License 2.0 4 votes vote down vote up
@TransactionAttribute(TransactionAttributeType.SUPPORTS)
public Person search(long id) {
    return em.find(Person.class, id);
}