com.frameworkset.platform.dictionary.DictionaryInit Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pdp-system Show documentation
Show all versions of pdp-system Show documentation
bboss public development platform base on bboss.
/**
*
*/
package com.frameworkset.platform.dictionary;
import java.util.List;
import javax.servlet.ServletContext;
import com.frameworkset.platform.config.DestroyException;
import com.frameworkset.platform.config.InitException;
import com.frameworkset.platform.config.SystemInit;
import com.frameworkset.platform.sysmgrcore.exception.ManagerException;
import com.frameworkset.common.poolman.DBUtil;
import com.frameworkset.dictionary.Data;
import com.frameworkset.dictionary.DataManager;
import com.frameworkset.dictionary.DataManagerFactory;
import com.frameworkset.dictionary.ProfessionDataManagerException;
/**
* 启动的时候, 把所有的字典类型对象加载到内存
* Title: DictionaryInit.java
*
* Description:
*
* Copyright: Copyright (c) 2006
*
* Company: bbossgroups
* @Date 2007-12-21 14:15:50
* @author ge.tao
* @version 1.0
*/
public class DictionaryInit implements SystemInit{
/* (non-Javadoc)
* @see com.frameworkset.platform.config.SystemInit#setContext(javax.servlet.ServletContext)
*/
public void setContext(ServletContext context) {
// TODO Auto-generated method stub
}
/* (non-Javadoc)
* @see com.frameworkset.platform.config.SystemInit#init()
* 把所有字典类型加载到内存 长时间等待...
*/
public void init() throws InitException {
DictManager dict = new DictManagerImpl();
try {
//做数据整理 把t.is_tree is null更新成 is_tree=0;
String update_sql = "update td_sm_dicttype t set t.is_tree=0 where t.is_tree is null";
DBUtil db = new DBUtil();
db.executeUpdate(update_sql);
//end
System.out.println("初始化字典数据开始.");
DataManager dataManager = DataManagerFactory.getDataManager();
List allDicttype = dict.getChildDicttypeList("");
for(int i=0;i