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.lewischooman.dao.ICustomerDAO.java

@Transactional(value = "txManager", propagation = Propagation.MANDATORY)
Status saveUser(Integer[] id, String longName, String password, String emailId, String contactNumber,
        String address);

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

@Transactional(propagation = Propagation.MANDATORY)
@Override/*  w  ww. ja v a2 s . c  o  m*/
public List<ShoppingCart> getAllShoppingCarts() {

    Query query = sf.getCurrentSession().createQuery("from Order");
    List<ShoppingCart> shoppingCarts = query.list();

    return shoppingCarts;
}

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

@Override
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public Owner find(UUID id) {
    try {//from  w w  w .j a v a  2s . co  m
        return (Owner) entityManager
                .createQuery("select l from " + type.getSimpleName() + " l where l.id = :id")
                .setParameter("id", id).getSingleResult();

    } catch (NoResultException e) {
        return null;
    }
}

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

@Transactional(propagation = Propagation.MANDATORY)
@Override/*from  ww w.  j  av a 2s. c o m*/
public List<ShoppingCartItem> getAllShoppingCartItems() {

    Query query = sf.getCurrentSession().createQuery("from ShoppingCartItem");
    List<ShoppingCartItem> shoppingCartItems = query.list();

    return shoppingCartItems;
}

From source file:nh.examples.springintegration.order.framework.domain.Repository.java

/**
 * Saves the given aggregate root.//from   w  w w .j a  v a2  s. com
 * 
 * @param aggregateRoot
 */
@Transactional(propagation = Propagation.MANDATORY)
public void save(T aggregateRoot) {
    checkNotNull(aggregateRoot);

    _logger.info("Saving {}", aggregateRoot);

    _entityManager.persist(aggregateRoot);
}

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

@Transactional(propagation = Propagation.MANDATORY)
@Override
public void removeAddress(Address address) {
    sf.getCurrentSession().delete(address);
}

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

@Override
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public Application find(UUID id) {
    try {//from  w  w w. j  a v a 2 s. c om
        return (Application) entityManager
                .createQuery("select l from " + type.getSimpleName() + " l where l.id = :id")
                .setParameter("id", id).getSingleResult();
    } catch (NoResultException e) {
        return null;
    }
}

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

@Override
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public Bookmark find(UUID id) {
    try {//from w  w  w  .  j a v a2  s.com
        return (Bookmark) entityManager
                .createQuery("select l from " + type.getSimpleName() + " l where l.id = :id")
                .setParameter("id", id).getSingleResult();

    } catch (NoResultException e) {
        return null;
    }
}

From source file:com.lewischooman.dao.IMovieShowDAO.java

@Transactional(value = "txManager", propagation = Propagation.MANDATORY)
MovieShowDB getMovieShowById(Integer movieShowId);

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

@Override
@Transactional(propagation = Propagation.MANDATORY, readOnly = true)
public Keyword find(UUID id) {
    try {/*w w  w . ja  va2s. c om*/
        return (Keyword) entityManager
                .createQuery("select l from " + type.getSimpleName() + " l where l.id = :id")
                .setParameter("id", id).getSingleResult();
    } catch (NoResultException e) {
        return null;
    }
}