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:com.inkubator.hrm.service.impl.MecineFingerServiceImpl.java

@Override
@Transactional(readOnly = true, isolation = Isolation.READ_COMMITTED, propagation = Propagation.SUPPORTS, timeout = 30)
public MecineFinger getEntiyByPK(Long id) throws Exception {
    return mecineFingerDao.getEntiyByPK(id);
}

From source file:it.geosdi.era.server.dao.hibernate.DAOUtenteHibernate.java

/**
 * Load the user with the argument login
 */// w  ww  .  j a  v  a2  s  .c  o m
@Transactional(propagation = Propagation.SUPPORTS)
public Utente findUtenteByUserName(String login) {
    // Create query
    //
    /*
     * StringBuffer hqlQuery = new StringBuffer();
     * hqlQuery.append("select utente from Utente utente");
     * hqlQuery.append(" left join fetch utente.progetti");
     * hqlQuery.append(" where utente.nomeUtente=:login");
     * 
     * // Fill query // Query query =
     * _entityManager.createQuery(hqlQuery.toString());
     * query.setParameter("login", login);
     */
    // Execute query
    //
    return null;// (Utente) query.getSingleResult();
}

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

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

From source file:es.upm.fiware.rss.expenditureLimit.server.test.BalanceAccumulatedServerTest.java

/**
 * /*  w w w  .  j a v  a  2s.c  o m*/
 * @throws Exception
 */
@Transactional(propagation = Propagation.SUPPORTS)
public void getUserAccumulated() throws Exception {

    Response response = server.getUserAccumulated(endUserId, serviceName, "agg123", "app123456", "EUR",
            "daily");
    Assert.assertEquals(200, response.getStatus());
}

From source file:it.geosdi.era.server.dao.hibernate.DAOStratoProgettoHibernate.java

@Transactional(propagation = Propagation.SUPPORTS)
public StratoProgetto findByProjectIdAndLayerName(long projectId, String layerName) {
    Session session = getSession();//from   w w  w  .j  a  v a  2s  .  c o  m
    Query query = session.createQuery(
            "select stratiProgetto from Progetto progetto join progetto.stratiProgetto stratiProgetto where progetto.id = ? and stratiProgetto.testoDaVisualizzare = ?");
    query.setParameter(0, projectId);
    query.setParameter(1, layerName);
    return (StratoProgetto) query.uniqueResult();
}

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

@Override
@Transactional(readOnly = false, isolation = Isolation.REPEATABLE_READ, propagation = Propagation.SUPPORTS, timeout = 30)
public SmsGatewayUser getEntiyByPK(Long id) throws Exception {
    return userDao.getEntiyByPK(id);
}

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

@Override
@Transactional(propagation = Propagation.SUPPORTS)
public SecretKeyToken generateSecretKey() {
    CryptoProfile cryptoProfile = cryptoProfileService.retrieveDefault();
    SecretKey secretKey = phoenixSymmetric.createSecretKey(cryptoProfile);
    return new InternalSecretKeyToken(secretKey);
}

From source file:it.geosdi.era.server.dao.hibernate.DAOProgettoHibernate.java

@Transactional(propagation = Propagation.SUPPORTS)
public Progetto findByNomeAndIdUtente(long idUtente, String nomeProgetto) throws DAOException {
    Session session = getSession();//from   w w  w . j av  a  2 s .  com
    Query query = (Query) session.createQuery(
            "select progetto from Progetto progetto join progetto.utentiProgetto utentiProgetto join utentiProgetto.utente utente where utente.id = ? and progetto.nomeProgetto = ?");
    query.setParameter(0, idUtente);
    query.setParameter(1, nomeProgetto);
    return (Progetto) query.uniqueResult();
}

From source file:gov.nih.nci.cabig.caaers.dao.ExpeditedAdverseEventReportDao.java

/**
 * This method will reassociate the domain object to hibernate session. With a lock mode none.
 * /*from w  w w  . j  a va 2s  .c  om*/
 * @param report -
 *                the domain object instance that is to be reassociated.
 */
@Override
@Transactional(propagation = Propagation.SUPPORTS)
public void reassociate(final ExpeditedAdverseEventReport report) {
    log.debug("Reassociating ExpeditedAdverseEventReport...");
    super.reassociate(report);

    if (report.getReporter() == null || report.getReporter().isTransient()) {
        log.debug("Reporter unsaved; skipping reassociate cascade");
    } else {
        getHibernateTemplate().lock(report.getReporter(), LockMode.NONE);
    }
    if (report.getPhysician() == null || report.getPhysician().isTransient()) {
        log.debug("Physican unsaved; skipping reassociate cascade");
    } else {
        getHibernateTemplate().lock(report.getPhysician(), LockMode.NONE);
    }
}

From source file:se.vgregion.urlservice.repository.jpa.JpaKeywordRepository.java

@Override
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
@SuppressWarnings("unchecked")
public List<Keyword> findByNamePrefix(String prefix) {
    try {// ww  w.ja va  2  s  .  co  m
        return entityManager.createQuery(
                "select l from " + type.getSimpleName() + " l " + "where name LIKE :prefix " + "order by name")
                .setParameter("prefix", prefix + "%").getResultList();
    } catch (NoResultException e) {
        return Collections.emptyList();
    }
}