首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

spring初始化数据库、对象的模式

2012-09-07 
spring初始化数据库、对象的方式1.实现SmartLifecycle接口@Lazy(false)@Repositorypublic class InitRedisC

spring初始化数据库、对象的方式
1.实现SmartLifecycle接口

@Lazy(false)@Repositorypublic class InitRedisCache implements ApplicationListener{@Autowired@Qualifier("dictionaryService")private DictionaryService dictionaryService;@Autowired@Qualifier("redisService")private RedisService redisService;@Overridepublic void onApplicationEvent(ApplicationEvent event) {if(event instanceof InitEvent){initDictionaryData();}}public  void initDictionaryData(){}}

热点排行