08 2020 档案
摘要:Mybatis遇到List传值时常用方法。 1. List<E>,E为基本数据类型和String Mapper类文件: List<User> selectByIds(List<String> userList); Mapper.xml文件: <select id="selectByIds" para
阅读全文
摘要:1. 不使用try-catch 查询结果:由于第二条插入语句报错,所以进行了事务回滚。 2. 使用try-catch 2. 1. 有try-catch,没有throw异常 查询结果:通过数据库查询结果发现第一条数据插入成功,第二条失败!事务没有进行回滚 2. 2. 有try-catch 并throw
阅读全文