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:de.crowdcode.bitemporal.example.PersonServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public Integer getAmountOfPerson() {
    Integer amount = personRepository.getAmount();
    return amount;
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from w  ww  .j  a v a 2s  .c o m
public List<User> getAllUsers() {
    List<User> users = null;
    try {
        Query query = sf.getCurrentSession().createQuery("from User");
        users = query.list();
    } catch (Exception e) {
    }

    return users;
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from  w  w w.j  av a 2 s. c  o  m
public Post getPost(int id) {
    Post post = (Post) sf.getCurrentSession().get(Post.class, id);
    return post;
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from  ww  w.  j a  v a2 s  . c  o  m
public Credential getCredential(int credentialid) {
    Credential cre = (Credential) sf.getCurrentSession().get(Credential.class, credentialid);
    return cre;
}

From source file:com.devicehive.service.IdentityProviderService.java

@Transactional(propagation = Propagation.SUPPORTS)
public IdentityProviderVO find(@NotNull String name) {
    return identityProviderDao.getByName(name);
}

From source file:org.brekka.phalanx.core.services.impl.PrincipalServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public AuthenticatedPrincipal authenticate(Principal principal, String password) {
    Principal managedUser = principalDAO.retrieveById(principal.getId());
    AsymmetricKeyPair defaultKeyPair = managedUser.getDefaultKeyPair();
    InternalPrivateKeyToken privateKeyToken = (InternalPrivateKeyToken) asymmetricCryptoService
            .decrypt(defaultKeyPair, password);
    InternalAuthenticatedUser authenticatedUser = new InternalAuthenticatedUser(managedUser, privateKeyToken);
    return authenticatedUser;
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override// www. ja  va 2s.c o m
public Enrollment getEnrollment(int id) {

    Enrollment enrollment = (Enrollment) sf.getCurrentSession().get(Enrollment.class, id);

    return enrollment;
}

From source file:org.horizontaldb.example.model.dao.PersonDaoImpl.java

@Override
@SuppressWarnings("unchecked")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public Collection<Person> getPersonNamesByDepartment(Long departmentId) {
    Query query = getQueryBuilder().query("from Person where department_id = :deparmentId").build();

    query.setParameter("deparmentId", departmentId);

    List<Person> retval = query.list();

    return retval;
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override//w  ww.j av  a2  s . c  o m
public List<Comment> getAllComments() {

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

From source file:com.devicehive.dao.rdbms.RdbmsGenericDao.java

@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public <T extends Serializable> T find(Class<T> entityClass, Object primaryKey) {
    return em.find(entityClass, primaryKey);
}