_012_SpringBoot_事务支持

--------------------

@EnableTransactionManagement     /*开启事务*/
public class Application {
    public static void main(String[] args) {
        SpringApplication.run(Application.class,args);
    }
}

------------------------

@Transactional
@Override
public int update() {
    Student student = new Student();
    student.setId(1);
    student.setName("hello-update");
    int i =  studentMapper.updateByPrimaryKeySelective(student);
    System.out.println("------"+i);
    return  i;
}

猜你喜欢

转载自blog.csdn.net/poiuyppp/article/details/81565064