参数书里的配置的
dao : {
type : "org.nutz.dao.impl.NutDao", // 1.b.53或以上版本使用原版NutDao.
args : [{refer:"dataSource"}],
fields : {
executor : {refer:"cacheExecutor"}
}
},
cacheExecutor : {
type : "org.nutz.plugins.cache.dao.CachedNutDaoExecutor",
fields : {
cacheProvider : {refer:"cacheProvider"},
// 需要缓存的表名
cachedTableNames : ["example"]
}
},
// 基于Ehcache的DaoCacheProvider
cacheProvider : {
type : "org.nutz.plugins.cache.dao.impl.provider.EhcacheDaoCacheProvider",
fields : {
cacheManager : {refer:"cacheManager"} // 引用ehcache.js中定义的CacheManager
},
events : {
create : "init"
}
}
var ioc = {
cacheManager : {
type : "net.sf.ehcache.CacheManager",
factory : "net.sf.ehcache.CacheManager#create"
}
};
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz</artifactId>
<version>1.r.55</version>
</dependency>
<!-- Nutz 框架 Dao缓存插件-->
<dependency>
<groupId>org.nutz</groupId>
<artifactId>nutz-plugins-daocache</artifactId>
<version>1.b.53.r2</version>
</dependency>
<!-- Ehcache -->
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.10.1</version>
</dependency>
<!-- SLF4J -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.19</version>
</dependency>
然后我执行一个查询
2016-03-22 13:28:08,764 [org.nutz.dao.impl.sql.run.NutDaoExecutor:org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:192)] SELECT * FROM example LIMIT 0, 2
2016-03-22 13:28:08,769 [org.nutz.dao.impl.sql.run.NutDaoExecutor:org.nutz.dao.impl.sql.run.NutDaoExecutor._runSelect(NutDaoExecutor.java:192)] SELECT COUNT(*) FROM example
还是有SQL呢 我配置错了嘛