iBATIS 三个版本小细节对比
sqlMapConfig.xml 中的异同:
iBATIS_v1 | iBATIS_v2 | iBATIS_v3 | |
DOCTYPE | sql-map-config.dtd | sql-map-config-2.dtd | ibatis-3-config.dtd |
configuration标签 | <sql-map-config> </sql-map-config> | <sqlMapConfig> </sqlMapConfig> | <configuration> </configuration> |
sqlMap标签 | <sql-map recource../> | <sqlMap recource../> | <mappers> <mapper recource.. /> </mappers> |
sqlMap 映射中的异同
iBATIS_v1 | iBATIS_v2 | iBATIS_v3 | |
DOCTYPE | sql-map.dtd | sql-map-2.dtd | ibatis-3-mapper.dtd |
sqlMap标签 | <sql-map> </sql-map> | <sqlMap> </sqlMap> | <mapper> </mapper> |
statement标签 | <mapped-statement> </mapped-statement> | <select></select> <update></update> <statement></>… | <select></select> <update></update> |
参数表示 | #id# | #id# | #{id} |
sqlMap API的异同
iBATIS_v1 | iBATIS_v2 | iBATIS_v3 | |
执行对象 | SqlMap | SqlMapClient | SqlSession |
得到执行 | XMLSqlMapBuilder-> builderSqlMap | SqlMapClientBuilder-> builderSqlMap | SqlSessionFactory-> openSession |
执行 | excuteQueryForObject | queryForObject.. queryForList… update… | selectOne… selectList… update… |
原文:http://www.iteye.com/topic/847698