MyBatis 的典型异常总结
一. 接口有参数, 调用时传参为空:
异常:
org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty ### The error may involve
出现原因: 接口中有 参数(集合), 实际调动中, 集合中没有元素, 就会报出此异常;
解决办法: 在业务逻辑处进行 非空判断: 只有集合中有元素时, 才调用该接口, 否则不调用;