protected static DBMeta FindCachedDBMeta(Type rowType) { System.Collections.Generic.IDictionary <Type, DBMeta> dbmetaCache = FindDBMetaCache(); if (dbmetaCache == null) { dbmetaCache = new System.Collections.Generic.Dictionary <Type, DBMeta>(); InternalMapContext.SetObject(DBMETA_CACHE_KEY, dbmetaCache); } if (dbmetaCache.ContainsKey(rowType)) { return(dbmetaCache[rowType]); } return(null); }
public static void RestoreAllContextOnThreadIfExists() { if (!IsExistContextStackOnThread()) { return; } Stack <ContextStack> stackOnThread = GetContextStackOnThread(); if (stackOnThread.Count == 0) { ClearContextStackOnThread(); return; } ContextStack contextStack = stackOnThread.Pop(); ConditionBean cb = contextStack.ConditionBean; if (cb != null) { ConditionBeanContext.SetConditionBeanOnThread(cb); } OutsideSqlContext outsideSqlContext = contextStack.OutsideSqlContext; if (outsideSqlContext != null) { OutsideSqlContext.SetOutsideSqlContextOnThread(outsideSqlContext); } FetchNarrowingBean fetchNarrowingBean = contextStack.FetchNarrowingBean; if (fetchNarrowingBean != null) { FetchNarrowingBeanContext.SetFetchNarrowingBeanOnThread(fetchNarrowingBean); } IDictionary <String, Object> internalMap = contextStack.InternalMap; if (internalMap != null) { InternalMapContext.ClearInternalMapOnThread(); foreach (String key in internalMap.Keys) { Object value = internalMap[key]; InternalMapContext.SetObject(key, value); } } }
protected void PutObjectToMapContext(String key, Object value) { InternalMapContext.SetObject(key, value); }