All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.alibaba.easyretry.extension.mybatis.dao.RetryTaskDAOImpl Maven / Gradle / Ivy

package com.alibaba.easyretry.extension.mybatis.dao;

import java.util.List;

import com.alibaba.easyretry.extension.mybatis.po.RetryTaskPO;
import com.alibaba.easyretry.extension.mybatis.query.RetryTaskQuery;

import java.util.List;

import org.apache.ibatis.session.SqlSessionFactory;

/**
 * @author Created by wuhao on 2020/11/8.
 */
public class RetryTaskDAOImpl extends BaseDAOSupport implements RetryTaskDAO {

	public RetryTaskDAOImpl(SqlSessionFactory sqlSessionFactory) {
		super(sqlSessionFactory);
	}

	@Override
	public boolean saveRetryTask(RetryTaskPO retryTaskPO) {
		return execute(
			sqlSession ->
				sqlSession.insert("com.alibaba.easyretry.extension.mybatis.dao.RetryTaskDAO.saveRetryTask", retryTaskPO) > 0
			, true);
	}

	@Override
	public List listRetryTask(RetryTaskQuery retryTaskQuery) {
		return execute(sqlSession ->
			sqlSession.selectList(
				"com.alibaba.easyretry.extension.mybatis.dao.RetryTaskDAO.listRetryTask",
				retryTaskQuery)
		);
	}

	@Override
	public boolean updateRetryTask(RetryTaskPO retryTaskPO) {
		return execute(sqlSession ->
				sqlSession.update(
					"com.alibaba.easyretry.extension.mybatis.dao.RetryTaskDAO.updateRetryTask",
					retryTaskPO)
					> 0
			, true);
	}

	@Override
	public boolean deleteRetryTask(RetryTaskPO retryTaskPO) {
		return execute(sqlSession ->
				sqlSession.delete(
					"com.alibaba.easyretry.extension.mybatis.dao.RetryTaskDAO.deleteRetryTask",
					retryTaskPO)
					> 0
			, true);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy