springboot配置事务

参考地址

//在启动类上加上
@EnableTransactionManagement
public class Application

    

//在实现类上加上
@Transactional(rollbackFor=Exception.class)
@Override
public int saveEnUserInfo(Map map) {
     String qyname = String.valueOf(map.get("qyname"));
     QhkcEnterprise qhkcEnterprise = new QhkcEnterprise();
}

 

你可能感兴趣的:(springBoot)