随笔分类 -  spring

摘要:摘要: Spring3.1使用自带的cache组件,方便项目中使用注释管理缓存。 一.在Spring配置文件中添加: <cache:annotation-driven/> 等价于: <!-- cacheManager为默认的缓存管理器名称 --> <cache:annotation-driven c 阅读全文
posted @ 2017-03-10 11:34 戏子诺 阅读(147) 评论(0) 推荐(0)
摘要:基于注解的事物: <tx:annotation-driven /> 需配置 org.springframework.jdbc.datasource.DataSourceTransactionManager 在service中加入 @transactional 1 默认遇到throw new Runt 阅读全文
posted @ 2017-03-10 11:14 戏子诺 阅读(130) 评论(0) 推荐(0)
摘要:String 中的@param Mybatis 中的@param 看似相同 ,但在使用xml时是有区别的 String中的@param在xml中需要如下这样引用变量,是根据参数的顺序来取值的,并且从0开始。 而在mybatis中的@param在xml中则是是通过参数名来引用的 如果用错后会报出这样的 阅读全文
posted @ 2016-07-11 15:06 戏子诺 阅读(320) 评论(0) 推荐(0)