All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nh.micro.db.MicroDbHolder Maven / Gradle / Ivy

There is a newer version: 1.2.1-RELEASE
Show newest version
package com.nh.micro.db;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 
 * @author ninghao
 *
 */
public class MicroDbHolder {
public static Map dbHolder=new HashMap();
public static Map readOnlyMap=new HashMap();
public static Map dbTypeMap=new HashMap();
public static Map getDbTypeMap() {
	return dbTypeMap;
}

public void setDbTypeMap(Map dbTypeMap) {
	MicroDbHolder.dbTypeMap = dbTypeMap;
}

public static Map getReadOnlyMap() {
	return readOnlyMap;
}

public static void setReadOnlyMap(Map readOnlyMap) {
	MicroDbHolder.readOnlyMap = readOnlyMap;
}

public static Map getDbHolder() {
	return dbHolder;
}

public void setDbHolder(Map dbHolder) {
	MicroDbHolder.dbHolder = dbHolder;
}

public static Object getDbSource(String sourceName){
	return dbHolder.get(sourceName);
}

public static List getReadOnlyList(String readOnlyName){
	List retList=new ArrayList();
	String readOnlyStr= (String) readOnlyMap.get(readOnlyName);
	if(readOnlyStr!=null){
		String[] tempArray=readOnlyStr.split(",");
		retList=Arrays.asList(tempArray);
	}
	return retList;
}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy