ITeye博客

spring mvc+ mybaties+ehcache(maven工程),在mapper.xml中使用

张-浩东 · 2016-02-02 15:29 · 企业架构 · Cache · Spring · maven · MVC · Markdown

参考网站: http://www.tuicool.com/articles/myeANv http://my.oschina.net/u/1469930/blog/388004 第一步: 在porm.xml文件中引入需要引进的jar包 org.mybatis mybatis-ehcache 1.0.0 org.ehcache ehcache 3.0.0.m3 第二步: 在根路径下创建ehcache.xml文件 第三步: 在spring-mybaties.xml中添加下面的代码 第四步: 测试 @RequestMapping("test") public void test(){ long beginTime=System.nanoTime(); Demo demo = demoMapper.selectByPrimaryKey(1L); long endTime=System.nanoTime(); System.out.println("查询时间 :" + (endTime-beginTime)+"ns"); }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。