老大修改個人代碼規範時加了它數據庫
Spring中的@Transactional(rollbackFor = Exception.class)事務處理,當你的方法中拋出異常時,它會將事務回滾到進入此方法前的狀態,數據庫中的數據將不會改變。app
[@Service](https://my.oschina.net/service) public class HexCaseConfServiceImpl implements HexCaseConfService { [@Resource](https://my.oschina.net/u/929718) private HexPmsCaseConfMapper hexPmsCaseConfMapper; @Transactional(rollbackFor = Throwable.class) [@Override](https://my.oschina.net/u/1162528) public MessageResult removeHexPmsCaseConf(String[] noticeIds) throws Exception { ... } }