1.service接口
package com.rfg.springbootmybaits.service;
import com.rfg.springbootmybaits.dto.PersonAddParam;
import org.springframework.transaction.annotation.Transactional;
/**
* @Author: RuanFuGui
* @Date: Created in 2020/5/17 20:28
* @Description: TODO
* @Version: 1.0
*/
public interface PersonService {
void insertPerson(PersonAddParam param);
}
2.service实现类
package com.rfg.springbootmybaits.service.impl;
import cn.hutool.core.thread.ThreadUtil;
import com.rfg.springbootmybaits.dto.PersonAddParam;
import com.rfg.springbootmybaits.service.PersonService;
import com.rfg.springbootmybaits.dao.PersonDAO;
import org.springframework.aop.framework.AopContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context

本文介绍了在Spring中如何配置和使用事务管理,在事务完成后如何异步执行额外的操作。通过示例展示了service接口、实现类、启动类以及测试类的详细设置。
最低0.47元/天 解锁文章
220

被折叠的 条评论
为什么被折叠?



