There is an update method in iBatis SqlMapClientTemplate
that allows to specify how many rows are expected to be updated (and throws exception if this is not matched).
Is there any equivalent to this method in MyBatis' sqlSession
? Those docs suggest there isn't.
What is the best way to implement such a check the other way?
Just came back to that question and realized that it was really trivial.
Source code of iBatis' overloaded update
just calls the regular update(String, Object)
and checks returned value.
As myBatis also has update(String, Object)
, this can be simply implemented the same way.
Simplicity of this method was probably the reason to drop its support in myBatis.