|
楼主 |
发表于 2016-9-16 15:35:45
|
显示全部楼层
集成daocache
- var ioc = {
- dataSource : {
- type : "com.alibaba.druid.pool.DruidDataSource",
- events : {
- create : "init",
- depose : 'close'
- },
- fields : {
- url : "jdbc:mysql://127.0.0.1:3306/x5",
- username : "root",
- password : "x5",
- testWhileIdle : true,
- validationQuery : "select 1",
- maxActive : 100
- }
- },
- dao : {
- type : "org.nutz.dao.impl.NutDao",
- args : [ {
- refer : "dataSource"
- } ],
- fields : {
- executor : {
- refer : "cacheExecutor"
- }
- }
- },
- cacheProvider : {
- type : "org.nutz.plugins.cache.dao.impl.provider.MemoryDaoCacheProvider",
- fields : {
- cacheSize : 10000
- },
- events : {
- create : "init"
- }
- },
- cacheExecutor : {
- type : "org.nutz.plugins.cache.dao.CachedNutDaoExecutor",
- fields : {
- cacheProvider : {
- refer : "cacheProvider"
- },
- cachedTableNames : [ "baseset","Token" ],
- }
- }
- };
复制代码
|
|