org.apache.ibatis.session.Configuration.hasResultMap()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.8k)|赞(0)|评价(0)|浏览(149)

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

Configuration.hasResultMap介绍

暂无

代码示例

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

public ResultMap resolveDiscriminatedResultMap(ResultSet rs, ResultMap resultMap, String columnPrefix) throws SQLException {
 Set<String> pastDiscriminators = new HashSet<String>();
 Discriminator discriminator = resultMap.getDiscriminator();
 while (discriminator != null) {
  final Object value = getDiscriminatorValue(rs, discriminator, columnPrefix);
  final String discriminatedMapId = discriminator.getMapIdFor(String.valueOf(value));
  if (configuration.hasResultMap(discriminatedMapId)) {
   resultMap = configuration.getResultMap(discriminatedMapId);
   Discriminator lastDiscriminator = discriminator;
   discriminator = resultMap.getDiscriminator();
   if (discriminator == lastDiscriminator || !pastDiscriminators.add(discriminatedMapId)) {
    break;
   }
  } else {
   break;
  }
 }
 return resultMap;
}

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

protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm) {
 if (!rm.hasNestedResultMaps() && rm.getDiscriminator() != null) {
  for (Map.Entry<String, String> entry : rm.getDiscriminator().getDiscriminatorMap().entrySet()) {
   String discriminatedResultMapName = entry.getValue();
   if (hasResultMap(discriminatedResultMapName)) {
    ResultMap discriminatedResultMap = resultMaps.get(discriminatedResultMapName);
    if (discriminatedResultMap.hasNestedResultMaps()) {
     rm.forceNestedResultMaps();
     break;
    }
   }
  }
 }
}

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

protected void checkLocallyForDiscriminatedNestedResultMaps(ResultMap rm) {
 if (!rm.hasNestedResultMaps() && rm.getDiscriminator() != null) {
  for (Map.Entry<String, String> entry : rm.getDiscriminator().getDiscriminatorMap().entrySet()) {
   String discriminatedResultMapName = entry.getValue();
   if (hasResultMap(discriminatedResultMapName)) {
    ResultMap discriminatedResultMap = resultMaps.get(discriminatedResultMapName);
    if (discriminatedResultMap.hasNestedResultMaps()) {
     rm.forceNestedResultMaps();
     break;
    }
   }
  }
 }
}

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

public ResultMap resolveDiscriminatedResultMap(ResultSet rs, ResultMap resultMap, String columnPrefix) throws SQLException {
 Set<String> pastDiscriminators = new HashSet<>();
 Discriminator discriminator = resultMap.getDiscriminator();
 while (discriminator != null) {
  final Object value = getDiscriminatorValue(rs, discriminator, columnPrefix);
  final String discriminatedMapId = discriminator.getMapIdFor(String.valueOf(value));
  if (configuration.hasResultMap(discriminatedMapId)) {
   resultMap = configuration.getResultMap(discriminatedMapId);
   Discriminator lastDiscriminator = discriminator;
   discriminator = resultMap.getDiscriminator();
   if (discriminator == lastDiscriminator || !pastDiscriminators.add(discriminatedMapId)) {
    break;
   }
  } else {
   break;
  }
 }
 return resultMap;
}

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

if (!configuration.hasResultMap(extend)) {
 throw new IncompleteElementException("Could not find a parent resultmap with id '" + extend + "'");

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

if (!configuration.hasResultMap(extend)) {
 throw new IncompleteElementException("Could not find a parent resultmap with id '" + extend + "'");

代码示例来源:origin: com.talanlabs/component-mybatis

@Override
public boolean hasResultMap(String id) {
  boolean res = super.hasResultMap(id);
  if (!res) {
    res = verifyAndCreateResultMap(id);
  }
  return res;
}

代码示例来源:origin: com.talanlabs/bean-mybatis

@Override
public boolean hasResultMap(String id) {
  boolean res = super.hasResultMap(id);
  if (!res) {
    res = verifyAndCreateResultMap(id);
  }
  return res;
}

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

public ResultMap resolveDiscriminatedResultMap(ResultSet rs, ResultMap resultMap) throws SQLException {
 Set<String> pastDiscriminators = new HashSet<String>();
 Discriminator discriminator = resultMap.getDiscriminator();
 while (discriminator != null) {
  final Object value = getDiscriminatorValue(rs, discriminator);
  final String discriminatedMapId = discriminator.getMapIdFor(String.valueOf(value));
  if (configuration.hasResultMap(discriminatedMapId)) {
   resultMap = configuration.getResultMap(discriminatedMapId);
   Discriminator lastDiscriminator = discriminator;
   discriminator = resultMap.getDiscriminator();
   if (discriminator == lastDiscriminator || !pastDiscriminators.add(discriminatedMapId)) {
    break;
   }
  } else {
   break;
  }
 }
 return resultMap;
}

代码示例来源:origin: io.github.itfinally/mybatis-jpa

@Override
  public ResultMap call() throws Exception {
    if ( !configuration.hasResultMap( token.getResultMapId() ) ) {
      try ( InputStream in = new ByteArrayInputStream( ResultMapBuilder
          .build( token, metadata ).getBytes() ) ) {
        new XMLMapperBuilder( in, configuration, token.getResultMapId(), configuration.getSqlFragments() ).parse();
      }
    }
    return configuration.getResultMap( token.getResultMapId() );
  }
} );

相关文章

Configuration类方法