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

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

Introduction

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

Prototype

Propagation NOT_SUPPORTED

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

Click Source Link

Document

Execute non-transactionally, suspend the current transaction if one exists.

Usage

From source file:com.wms.studio.service.LoginIpServiceImpl.java

@Override
@org.springframework.transaction.annotation.Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public PageDto<LoginIpInfoDto> findBy(final String userId, final Date start, final Date end,
        PageSize pageSize) {//from   w w w.  j a  v  a  2s .c  o m

    if (pageSize == null) {
        pageSize = new PageSize();
    }

    return loginIpConvert.covertToDto(loginIpRepository.findAll(new Specification<LoginIp>() {

        @Override
        public Predicate toPredicate(Root<LoginIp> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
            List<Predicate> pres = new ArrayList<>(3);

            if (start != null) {
                pres.add(cb.greaterThanOrEqualTo(root.get("loginTime").as(Date.class), start));
            }

            if (end != null) {
                pres.add(cb.lessThanOrEqualTo(root.get("loginTime").as(Date.class), end));
            }

            if (!StringUtils.isBlank(userId)) {
                pres.add(cb.equal(root.get("user").as(User.class), new User(userId)));
            }

            Predicate[] p = new Predicate[pres.size()];
            return cb.and(pres.toArray(p));
        }
    }, new PageRequest(pageSize.getPage() - 1, pageSize.getLimit())));
}

From source file:com.xyz.framework.data.impl.JpaDao.java

/**
 * ./*from   w  ww. j a v a 2  s . c  o  m*/
 * 
 * @param page
 *            ?.??orderBy?.
 * @param jdoQl
 *            hql?.
 * @param values
 *            ????,?.
 * 
 * @return , ??.
 */
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public Page<T> findPage(final Page<T> page) {
    Assert.notNull(page, "page?");
    String sql = getBaseSql();
    sql = dealOrder(sql, page);
    Query query = entityManager.createQuery(sql);
    if (page.isAutoCount()) {
        int totalCount = countJpaQlResult("");
        page.setTotalCount(totalCount);
    }
    query.setFirstResult(page.getStart());
    query.setMaxResults(page.getLimit());
    List<T> lt = query.getResultList();
    page.setResult(lt);
    return page;
}

From source file:com.gettec.fsnip.fsn.service.product.impl.ProductInstanceServiceImpl.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = Exception.class)
public ProductInstance findByBSB(String batchSerialNo, String serial, String barcode) {
    return getDAO().findByBSB(batchSerialNo, serial, barcode);
}

From source file:com.gcrm.service.impl.BaseService.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public long countsByParams(String hql, Object[] paramValues) {
    return baseDao.countsByParams(hql, paramValues);
}

From source file:com.gettec.fsnip.fsn.service.product.impl.ProductInstanceServiceImpl.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = Exception.class)
public ProductInstance findLastBySP(String serial, Long productId) {
    return getDAO().findLastBySP(serial, productId);
}

From source file:com.gcrm.service.impl.OptionService.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public T findByValue(String clazz, String value) {
    String hql = "from " + clazz + " where value = ?";
    T object = null;/*from w  w  w.  ja v  a 2  s .c  om*/
    List<T> result = null;

    result = findByParam(hql, value);
    if (result != null && result.size() > 0) {
        object = result.get(0);
    }
    return object;
}

From source file:com.gettec.fsnip.fsn.service.product.impl.ProductInstanceServiceImpl.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, rollbackFor = Exception.class)
public ProductInstance findByBatchAndProductId(String batchSerialNo, Long productId) {
    return getDAO().findByBatchAndProductId(batchSerialNo, productId);
}

From source file:com.mycomm.dao.mydao.base.MyDaoSupport.java

@Transactional(readOnly = true, propagation = Propagation.NOT_SUPPORTED)
public ResultHelp<T> getScrollData(int firstindex, int maxresult, String wherejpql, Object[] queryParams) {
    return getScrollData(firstindex, maxresult, wherejpql, queryParams, null);
}

From source file:com.gcrm.service.impl.BaseService.java

@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public List<T> findByHQL(String hql) {
    return baseDao.findByHQL(hql);
}

From source file:org.hsweb.web.datasource.dynamic.DynamicDataSourceSqlExecutorService.java

@Transactional(propagation = Propagation.NOT_SUPPORTED)
public void exec(String sql) throws SQLException {
    super.exec(new SimpleSQL(sql));
}