org.apache.ibatis.executor.Executor.isCached()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中org.apache.ibatis.executor.Executor.isCached()方法的一些代码示例,展示了Executor.isCached()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Executor.isCached()方法的具体详情如下:
包路径:org.apache.ibatis.executor.Executor
类名称:Executor
方法名:isCached

Executor.isCached介绍

暂无

代码示例

代码示例来源:origin: camunda/camunda-bpm-platform

@Override
public boolean isCached(MappedStatement ms, CacheKey key) {
 return delegate.isCached(ms, key);
}

代码示例来源:origin: org.mybatis/mybatis

@Override
public boolean isCached(MappedStatement ms, CacheKey key) {
 return delegate.isCached(ms, key);
}

代码示例来源:origin: ldlqdsdcn/eidea4

@Override
public boolean isCached(MappedStatement ms, CacheKey key) {
  return executor.isCached(ms, key);
}

代码示例来源:origin: camunda/camunda-bpm-platform

private Object getNestedQueryMappingValue(ResultSet rs, MetaObject metaResultObject, ResultMapping propertyMapping, ResultLoaderMap lazyLoader, String columnPrefix)
  throws SQLException {
 final String nestedQueryId = propertyMapping.getNestedQueryId();
 final String property = propertyMapping.getProperty();
 final MappedStatement nestedQuery = configuration.getMappedStatement(nestedQueryId);
 final Class<?> nestedQueryParameterType = nestedQuery.getParameterMap().getType();
 final Object nestedQueryParameterObject = prepareParameterForNestedQuery(rs, propertyMapping, nestedQueryParameterType, columnPrefix);
 Object value = null;
 if (nestedQueryParameterObject != null) {
  final BoundSql nestedBoundSql = nestedQuery.getBoundSql(nestedQueryParameterObject);
  final CacheKey key = executor.createCacheKey(nestedQuery, nestedQueryParameterObject, RowBounds.DEFAULT, nestedBoundSql);
  final Class<?> targetType = propertyMapping.getJavaType();
  if (executor.isCached(nestedQuery, key)) {
   executor.deferLoad(nestedQuery, metaResultObject, property, key, targetType);
   value = DEFERED;
  } else {
   final ResultLoader resultLoader = new ResultLoader(configuration, executor, nestedQuery, nestedQueryParameterObject, targetType, key, nestedBoundSql);
   if (propertyMapping.isLazy()) {
    lazyLoader.addLoader(property, metaResultObject, resultLoader);
    value = DEFERED;
   } else {
    value = resultLoader.loadResult();
   }
  }
 }
 return value;
}

代码示例来源:origin: org.mybatis/mybatis

private Object getNestedQueryMappingValue(ResultSet rs, MetaObject metaResultObject, ResultMapping propertyMapping, ResultLoaderMap lazyLoader, String columnPrefix)
  throws SQLException {
 final String nestedQueryId = propertyMapping.getNestedQueryId();
 final String property = propertyMapping.getProperty();
 final MappedStatement nestedQuery = configuration.getMappedStatement(nestedQueryId);
 final Class<?> nestedQueryParameterType = nestedQuery.getParameterMap().getType();
 final Object nestedQueryParameterObject = prepareParameterForNestedQuery(rs, propertyMapping, nestedQueryParameterType, columnPrefix);
 Object value = null;
 if (nestedQueryParameterObject != null) {
  final BoundSql nestedBoundSql = nestedQuery.getBoundSql(nestedQueryParameterObject);
  final CacheKey key = executor.createCacheKey(nestedQuery, nestedQueryParameterObject, RowBounds.DEFAULT, nestedBoundSql);
  final Class<?> targetType = propertyMapping.getJavaType();
  if (executor.isCached(nestedQuery, key)) {
   executor.deferLoad(nestedQuery, metaResultObject, property, key, targetType);
   value = DEFERRED;
  } else {
   final ResultLoader resultLoader = new ResultLoader(configuration, executor, nestedQuery, nestedQueryParameterObject, targetType, key, nestedBoundSql);
   if (propertyMapping.isLazy()) {
    lazyLoader.addLoader(property, metaResultObject, resultLoader);
    value = DEFERRED;
   } else {
    value = resultLoader.loadResult();
   }
  }
 }
 return value;
}

代码示例来源:origin: org.apache.ibatis/ibatis-core

protected Object getNestedQueryMappingValue(ResultSet rs, MetaObject metaResultObject, ResultMapping propertyMapping, ResultLoaderMap lazyLoader) throws SQLException {
 final String nestedQueryId = propertyMapping.getNestedQueryId();
 final String property = propertyMapping.getProperty();
 final MappedStatement nestedQuery = configuration.getMappedStatement(nestedQueryId);
 final Class nestedQueryParameterType = nestedQuery.getParameterMap().getType();
 final Object nestedQueryParameterObject = prepareParameterForNestedQuery(rs, propertyMapping, nestedQueryParameterType);
 Object value = null;
 if (nestedQueryParameterObject != null) {
  final CacheKey key = executor.createCacheKey(nestedQuery, nestedQueryParameterObject, RowBounds.DEFAULT);
  if (executor.isCached(nestedQuery, key)) {
   executor.deferLoad(nestedQuery, metaResultObject, property, key);
  } else {
   final ResultLoader resultLoader = new ResultLoader(configuration, executor, nestedQuery, nestedQueryParameterObject, propertyMapping.getJavaType());
   if (configuration.isLazyLoadingEnabled()) {
    lazyLoader.addLoader(property, metaResultObject, resultLoader);
   } else {
    value = resultLoader.loadResult();
   }
  }
 }
 return value;
}

相关文章