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:org.apigw.authserver.svc.impl.CertifiedClientDetailsServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public ClientDetails loadClientByClientId(String clientId) throws NoSuchClientException {
    log.debug("loadClientByClientId(clientId:{})", clientId);
    // client id - query
    CertifiedClient client = certifiedClientRepository.findClientByClientIdEager(clientId);

    if (client == null) {
        log.warn("No client with id {} found", clientId);
        throw new UsernameNotFoundException("No client with id " + clientId + " found");
    } else {//from  w w w  .  j a  v a  2s . com
        log.debug("returning from loadClientByClientId with client");
        return client;
    }
}

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

@Transactional(propagation = Propagation.SUPPORTS)
@Override/*from   ww  w. j  a v  a 2 s .c  o m*/
public List<Enrollment> getEnrollmentsByCustomerID(int customerId) {

    List<Enrollment> enrollments;

    Query query = sf.getCurrentSession().createQuery("from Enrollment e where e.customer.id=customerId");
    enrollments = query.list();

    return enrollments;
}

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

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public Collection<Address> findAuditedAdressesWithRevision(Integer revisionNumber) {
    Collection<Address> addresses = addressRepository.findAuditedAdressesWithRevision(revisionNumber);
    return addresses;
}

From source file:com.oak_yoga_studio.service.impl.FacultyServiceImpl.java

@Transactional(propagation = Propagation.SUPPORTS)
@Override//from  w  w w . ja va  2  s  . com
public List<Faculty> getListOfActiveFaculty() {
    try {
        return facultyDAO.getAllActiveFaculties();
    } catch (Exception e) {
        return new ArrayList();
    }

}

From source file:com.bsb.cms.moss.service.impl.auth.SysRoleServiceImpl.java

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public boolean isRename(String name, Long sysRoleId) {
    Map<String, Object> map = new HashMap<String, Object>();
    map.put("roleName", name);
    map.put("sysRoleId", sysRoleId);
    Long count = sysRoleMapper.hasRename(map);// ?
    return (count != null && count > 0) ? true : false;
}

From source file:com.inkubator.hrm.service.impl.BioRelasiPerusahaanServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public List<BioRelasiPerusahaan> getAllDataByBioDataId(Long bioDataId) throws Exception {
    return bioRelasiPerusahaanDao.getAllDataByBioDataId(bioDataId);
}

From source file:com.inkubator.hrm.service.impl.PayTempOvertimeServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 50)
public Long getTotalByParam(PayTempOvertimeSearchParameter searchParameter) throws Exception {
    return payTempOvertimeDao.getTotalByParam(searchParameter);
}

From source file:com.brienwheeler.svc.attrs.impl.PersistentAttributeServiceBase.java

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
@MonitoredWork("getAttribute")
@GracefulShutdown/*from ww w . j  a  v  a  2s. c om*/
public Map<String, String> getAttributes(DbId<OwnerClass> owner) {
    DbValidationUtils.assertPersisted(owner);

    List<AttrClass> attributes = persistentAttributeDao.findByOwner(owner.getId());
    Map<String, String> attributeMap = new HashMap<String, String>(attributes.size());
    for (AttrClass attribute : attributes) {
        attributeMap.put(attribute.getName(), attribute.getValue());
    }
    return Collections.unmodifiableMap(attributeMap);
}

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

@Override
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
@SuppressWarnings("unchecked")
public List<UserGroupMember> findForUserAndType(User user, String groupType) {
    Query query = entityManager//  w w w . jav a 2 s  .c o  m
            .createQuery("from UserGroupMember u where u.user = :user and u.userGroup.groupType = :groupType");
    query.setParameter("user", user);
    query.setParameter("groupType", groupType);
    return (List<UserGroupMember>) query.getResultList();
}

From source file:com.inkubator.hrm.service.impl.BioSertifikasiServiceImpl.java

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