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

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

Introduction

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

Prototype

Propagation MANDATORY

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

Click Source Link

Document

Support a current transaction, throw an exception if none exists.

Usage

From source file:com.epam.catgenome.dao.DaoHelper.java

/**
 * Clears all records from a temporary list identified by the given ID.
 *
 * @param listId {@code Long} represents unique ID of a temporary list that has to be cleared
 * @return int represents the number of affected (deleted) rows
 */// w  ww. ja va  2 s.  c om
@Transactional(propagation = Propagation.MANDATORY)
public int clearTempList(final Long listId) {
    Assert.notNull(listId);
    return getNamedParameterJdbcTemplate().update(clearTemporaryListQuery,
            new MapSqlParameterSource(HelperParameters.LIST_ID.name(), listId));
}

From source file:se.vgregion.dao.domain.patterns.repository.db.jpa.AbstractJpaRepository.java

/**
 * {@inheritDoc}/*ww w . ja  va 2 s. c  o m*/
 * 
 * @throws {@link IllegalTransactionStateException} if the method is invoked without an existing transaction.
 */
@Transactional(propagation = Propagation.MANDATORY)
public void flush() {
    entityManager.flush();
}

From source file:com.bitsofproof.supernode.model.JpaStore.java

@Override
@Transactional(propagation = Propagation.MANDATORY)
protected void updateColor(TxOut root, String fungibleName) {
    root.setColor(fungibleName);
}

From source file:com.epam.catgenome.dao.DaoHelper.java

@Transactional(propagation = Propagation.MANDATORY)
public int clearTempStringList(final Long listId) {
    Assert.notNull(listId);/*from   w  w  w .  ja v a  2 s  . c o  m*/
    return getNamedParameterJdbcTemplate().update(clearTemporaryStringListQuery,
            new MapSqlParameterSource(HelperParameters.LIST_ID.name(), listId));
}

From source file:com.epam.catgenome.dao.reference.ReferenceGenomeDao.java

@Transactional(propagation = Propagation.MANDATORY)
public Chromosome loadChromosome(final Long chromosomeId) {
    final List<Chromosome> list = getNamedParameterJdbcTemplate().query(loadChromosomeByIdQuery,
            new MapSqlParameterSource(GenomeParameters.CHROMOSOME_ID.name(), chromosomeId),
            GenomeParameters.getChromosomeMapper());
    return CollectionUtils.isNotEmpty(list) ? list.get(0) : null;
}

From source file:se.vgregion.dao.domain.patterns.repository.db.jpa.AbstractJpaRepository.java

/**
 * {@inheritDoc}/*w  w  w.  j  a v a2 s  .  c  o  m*/
 * 
 * @throws {@link IllegalTransactionStateException} if the method is invoked without an existing transaction.
 */
@Transactional(propagation = Propagation.MANDATORY)
public T persist(T entity) {
    entityManager.persist(entity);
    return entity;
}

From source file:com.epam.catgenome.dao.reference.ReferenceGenomeDao.java

@Transactional(propagation = Propagation.MANDATORY)
public List<Chromosome> loadAllChromosomesByReferenceId(final Long referenceId) {
    return getNamedParameterJdbcTemplate().query(loadAllChromosomesByReferenceIdQuery,
            new MapSqlParameterSource(GenomeParameters.REFERENCE_GENOME_ID.name(), referenceId),
            GenomeParameters.getChromosomeMapper());
}

From source file:se.vgregion.dao.domain.patterns.repository.db.jpa.AbstractJpaRepository.java

/**
 * {@inheritDoc}/* w w  w. j  ava2s  . c  o  m*/
 * 
 * @throws {@link IllegalTransactionStateException} if the method is invoked without an existing transaction.
 */
@Transactional(propagation = Propagation.MANDATORY)
public void remove(T entity) {
    entityManager.remove(entity);
}

From source file:com.epam.catgenome.dao.reference.ReferenceGenomeDao.java

@Transactional(propagation = Propagation.MANDATORY)
public List<BaseEntity> loadAllFileByReferenceId(final Long referenceId) {
    return getNamedParameterJdbcTemplate().query(loadBiologicalItemsQuery,
            new MapSqlParameterSource(GenomeParameters.REFERENCE_GENOME_ID.name(), referenceId),
            GenomeParameters.getBioDataMapper());
}

From source file:se.vgregion.dao.domain.patterns.repository.db.jpa.AbstractJpaRepository.java

/**
 * {@inheritDoc}/*  ww  w .  jav a2s .  c  om*/
 * 
 * @throws {@link IllegalTransactionStateException} if the method is invoked without an existing transaction.
 */
@Transactional(propagation = Propagation.MANDATORY)
public void remove(ID id) {
    T entity = find(id);
    entityManager.remove(entity);
}