本文整理了Java中org.apache.ibatis.session.Configuration.getCache()
方法的一些代码示例,展示了Configuration.getCache()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getCache()
方法的具体详情如下:
包路径:org.apache.ibatis.session.Configuration
类名称:Configuration
方法名:getCache
暂无
代码示例来源:origin: camunda/camunda-bpm-platform
public Cache useCacheRef(String namespace) {
if (namespace == null) {
throw new BuilderException("cache-ref element requires a namespace attribute.");
}
try {
unresolvedCacheRef = true;
Cache cache = configuration.getCache(namespace);
if (cache == null) {
throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.");
}
currentCache = cache;
unresolvedCacheRef = false;
return cache;
} catch (IllegalArgumentException e) {
throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.", e);
}
}
代码示例来源:origin: org.mybatis/mybatis
public Cache useCacheRef(String namespace) {
if (namespace == null) {
throw new BuilderException("cache-ref element requires a namespace attribute.");
}
try {
unresolvedCacheRef = true;
Cache cache = configuration.getCache(namespace);
if (cache == null) {
throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.");
}
currentCache = cache;
unresolvedCacheRef = false;
return cache;
} catch (IllegalArgumentException e) {
throw new IncompleteElementException("No cache for namespace '" + namespace + "' could be found.", e);
}
}
代码示例来源:origin: com.talanlabs/bean-mybatis
@Override
public Cache getCache(String id) {
if (hasCache(id)) {
return super.getCache(id);
}
return super.getCache(id);
}
代码示例来源:origin: com.talanlabs/component-mybatis
@Override
public Cache getCache(String id) {
if (hasCache(id)) {
return super.getCache(id);
}
return super.getCache(id);
}
代码示例来源:origin: org.apache.ibatis/ibatis-core
public Cache useCacheRef(String namespace) {
if (namespace == null) {
throw new BuilderException("cache-ref element requires a namespace attribute.");
}
Cache cache = configuration.getCache(namespace);
if (cache == null) {
throw new BuilderException("No cache for namespace '" + namespace + "' could be found.");
}
currentCache = cache;
return cache;
}
代码示例来源:origin: com.talanlabs/bean-mybatis
@Override
public void clear() {
if (beanCacheManager.isDispatch()) {
beanCacheManager.undispatch();
beanCacheManager.getCacheLinks(beanClass).forEach(cacheName -> configuration.getCache(cacheName).clear());
beanCacheManager.dispatch();
beanCacheManager.fireCleared(getId());
}
}
代码示例来源:origin: com.hand.hap.cloud/hap-mybatis-mapper-starter
/**
* 检查是否配置过缓存
*
* @param ms
* @throws Exception
*/
private void checkCache(MappedStatement ms) throws Exception {
if (ms.getCache() == null) {
String nameSpace = ms.getId().substring(0, ms.getId().lastIndexOf("."));
Cache cache;
try {
//不存在的时候会抛出异常
cache = ms.getConfiguration().getCache(nameSpace);
} catch (IllegalArgumentException e) {
return;
}
if (cache != null) {
MetaObject metaObject = SystemMetaObject.forObject(ms);
metaObject.setValue("cache", cache);
}
}
}
代码示例来源:origin: com.talanlabs/component-mybatis
@Override
public void clear() {
if (componentCacheManager.isDispatch()) {
componentCacheManager.undispatch();
componentCacheManager.getCacheLinks(componentClass).forEach(cacheName -> configuration.getCache(cacheName).clear());
componentCacheManager.dispatch();
componentCacheManager.fireCleared(getId());
}
}
内容来源于网络,如有侵权,请联系作者删除!