Example usage for org.springframework.transaction.annotation Propagation SUPPORTS

List of usage examples for org.springframework.transaction.annotation Propagation SUPPORTS

Introduction

In this page you can find the example usage for org.springframework.transaction.annotation Propagation SUPPORTS.

Prototype

Propagation SUPPORTS

To view the source code for org.springframework.transaction.annotation Propagation SUPPORTS.

Click Source Link

Document

Support a current transaction, execute non-transactionally if none exists.

Usage

From source file:cs544.wamp_blog_engine.dao.impl.LoginHistoryDAOImpl.java

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from  w  w w .  j av  a  2 s  . co m
public List<LoginHistory> getAllLoginHistory() {

    Query query = sf.getCurrentSession().createQuery("from LoginHistory");
    List<LoginHistory> historys = query.list();
    return historys;
}

From source file:cs544.wamp_blog_engine.dao.impl.CategoryDAOImpl.java

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from   w ww .  j  a v a2 s  . c  o  m
public List<Category> getAllCategorys() {
    Query query = sf.getCurrentSession().createQuery("from Category");

    List<Category> categorys = query.list();
    System.out.println("num of cats: in dao " + categorys.size());
    return categorys;
}

From source file:org.jrecruiter.service.impl.FlexServiceImpl.java

/** {@inheritDoc} */
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public List<Job> getJobSummaries() {
    return jobDao.getJobSummaries();
}

From source file:com.oak_yoga_studio.dao.impl.CustomerDAOImpl.java

/**
 *
 * @returns only Customer users//from   w w w  .  j  a  v a 2 s  . c  o m
 */
@Transactional(propagation = Propagation.SUPPORTS)
@Override
public List<Customer> getAllCustomers() {
    List<Customer> customers;
    Query query = sf.getCurrentSession().createQuery("from Customer");
    customers = query.list();

    return customers;
}

From source file:com.brienwheeler.svc.users.impl.UserDao.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public User findByUsername(String username) {
    Query query = entityManager.createQuery("from User where username = :username");
    query.setParameter("username", username);
    return getSingleResultOrNull(query);
}

From source file:de.crowdcode.bitemporal.example.PersonServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public Collection<Person> findAllPersons() {
    Collection<Person> persons = personRepository.findAll();
    return persons;
}

From source file:com.inkubator.sms.gateway.service.impl.RoleServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public Role getEntiyByPK(Long l) throws Exception {
    return roleDao.getEntiyByPK(l);
}

From source file:cs544.wamp_blog_engine.dao.impl.PostDAOImpl.java

@Transactional(propagation = Propagation.SUPPORTS)
@Override//  www.j a v  a 2s  . c  o m
public List<Post> getAllPosts() {
    Query query = sf.getCurrentSession().createQuery("from Post");
    List<Post> posts = query.list();
    return posts;
}

From source file:it.scoppelletti.programmerpower.wui.WebApplicationRegistry.java

@Transactional(propagation = Propagation.SUPPORTS)
public String getBaseUrl() {
    if (Strings.isNullOrEmpty(myBaseUrl)) {
        throw new PropertyNotSetException(toString(), "baseUrl");
    }//from  ww  w .j  a  v a  2s  .  c om

    return myBaseUrl;
}

From source file:com.brienwheeler.svc.usergroups.impl.UserGroupDao.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public UserGroup findByNameAndType(String groupName, String groupType) {
    Query query = entityManager//from   w  w  w . j av  a  2  s .co  m
            .createQuery("from UserGroup where groupName = :groupName and groupType = :groupType");
    query.setParameter("groupName", groupName);
    query.setParameter("groupType", groupType);
    return getSingleResultOrNull(query);
}