2

For Spring 2.5.6 and above the two reasons that I can think of for choosing spring jdbc are :

  1. BeanPropertySqlParameterSource - for insert/update
  2. ParameterizedBeanPropertyRowMapper - for select

These two give you the power of basic orm as you don't need to code your rowmappers.

Thoughts/Comments?

4

1 回答 1

4

IBatis 为您提供开箱即用的缓存,而 SpringJDBC 没有。有些人可能更喜欢使用声明性方法(在 IBatis 中是 XML)来定义他们的查询。使用左连接填充 1:n 关系而不运行 n+1 选择可能更容易使用 IBatis。最后,您可以在同一个项目中使用这两种方法,并根据您要解决的问题挑选您选择的框架。

于 2011-04-06T16:40:44.050 回答