亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? autoresultmap.java

?? 本套系統采用了業界當前最為流行的beanAction組件
?? JAVA
字號:
/*
 *  Copyright 2004 Clinton Begin
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.ibatis.sqlmap.engine.mapping.result;

import com.ibatis.common.beans.ClassInfo;
import com.ibatis.common.beans.Probe;
import com.ibatis.common.beans.ProbeFactory;

import com.ibatis.sqlmap.client.SqlMapException;
import com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate;
import com.ibatis.sqlmap.engine.scope.RequestScope;
import com.ibatis.sqlmap.engine.type.DomTypeMarker;

import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * An automatic result map for simple stuff
 */
public class AutoResultMap extends BasicResultMap {

  /**
   * Constructor to pass in the SqlMapExecutorDelegate
   *
   * @param delegate - the delegate
   */
  public AutoResultMap(SqlMapExecutorDelegate delegate, boolean allowRemapping) {
    super(delegate);
    this.allowRemapping = allowRemapping;
  }

  public synchronized Object[] getResults(RequestScope request, ResultSet rs)
      throws SQLException {
    if (allowRemapping || getResultMappings() == null) {
      initialize(rs);
    }
    return super.getResults(request, rs);
  }

  private void initialize(ResultSet rs) {
    if (getResultClass() == null) {
      throw new SqlMapException("The automatic ResultMap named " + this.getId() + " had a null result class (not allowed).");
    } else if (Map.class.isAssignableFrom(getResultClass())) {
      initializeMapResults(rs);
    } else if (getDelegate().getTypeHandlerFactory().getTypeHandler(getResultClass()) != null) {
      initializePrimitiveResults(rs);
    } else if (DomTypeMarker.class.isAssignableFrom(getResultClass())) {
      initializeXmlResults(rs);
    } else {
      initializeBeanResults(rs);
    }
  }

  private void initializeBeanResults(ResultSet rs) {
    try {
      ClassInfo classInfo = ClassInfo.getInstance(getResultClass());
      String[] propertyNames = classInfo.getWriteablePropertyNames();

      Map propertyMap = new HashMap();
      for (int i = 0; i < propertyNames.length; i++) {
        propertyMap.put(propertyNames[i].toUpperCase(java.util.Locale.ENGLISH), propertyNames[i]);
      }

      List resultMappingList = new ArrayList();
      ResultSetMetaData rsmd = rs.getMetaData();
      for (int i = 0, n = rsmd.getColumnCount(); i < n; i++) {
        String columnName = rsmd.getColumnLabel(i + 1);
        String upperColumnName = columnName.toUpperCase(java.util.Locale.ENGLISH);
        String matchedProp = (String) propertyMap.get(upperColumnName);
        Class type = null;
        if (matchedProp == null) {
          Probe p = ProbeFactory.getProbe(this.getResultClass());
          try {
            type = p.getPropertyTypeForSetter(this.getResultClass(), columnName);
          } catch (Exception e) {
            //TODO - add logging to this class?
          }
        } else {
          type = classInfo.getSetterType(matchedProp);
        }
        if (type != null || matchedProp != null) {
          BasicResultMapping resultMapping = new BasicResultMapping();
          resultMapping.setPropertyName((matchedProp != null ? matchedProp : columnName));
          resultMapping.setColumnName(columnName);
          resultMapping.setColumnIndex(i + 1);
          resultMapping.setTypeHandler(getDelegate().getTypeHandlerFactory().getTypeHandler(type)); //map SQL to JDBC type
          resultMappingList.add(resultMapping);
        }
      }
      setResultMappingList(resultMappingList);

    } catch (SQLException e) {
      throw new RuntimeException("Error automapping columns. Cause: " + e);
    }

  }

  private void initializeXmlResults(ResultSet rs) {
    try {
      List resultMappingList = new ArrayList();
      ResultSetMetaData rsmd = rs.getMetaData();
      for (int i = 0, n = rsmd.getColumnCount(); i < n; i++) {
        String columnName = rsmd.getColumnLabel(i + 1);
        BasicResultMapping resultMapping = new BasicResultMapping();
        resultMapping.setPropertyName(columnName);
        resultMapping.setColumnName(columnName);
        resultMapping.setColumnIndex(i + 1);
        resultMapping.setTypeHandler(getDelegate().getTypeHandlerFactory().getTypeHandler(String.class));
        resultMappingList.add(resultMapping);
      }
      setResultMappingList(resultMappingList);
    } catch (SQLException e) {
      throw new RuntimeException("Error automapping columns. Cause: " + e);
    }
  }

  private void initializeMapResults(ResultSet rs) {
    try {
      List resultMappingList = new ArrayList();
      ResultSetMetaData rsmd = rs.getMetaData();
      for (int i = 0, n = rsmd.getColumnCount(); i < n; i++) {
        String columnName = rsmd.getColumnLabel(i + 1);
        BasicResultMapping resultMapping = new BasicResultMapping();
        resultMapping.setPropertyName(columnName);
        resultMapping.setColumnName(columnName);
        resultMapping.setColumnIndex(i + 1);
        resultMapping.setTypeHandler(getDelegate().getTypeHandlerFactory().getTypeHandler(Object.class));
        resultMappingList.add(resultMapping);
      }

      setResultMappingList(resultMappingList);

    } catch (SQLException e) {
      throw new RuntimeException("Error automapping columns. Cause: " + e);
    }
  }

  private void initializePrimitiveResults(ResultSet rs) {
    try {
      ResultSetMetaData rsmd = rs.getMetaData();
      String columnName = rsmd.getColumnLabel(1);
      BasicResultMapping resultMapping = new BasicResultMapping();
      resultMapping.setPropertyName(columnName);
      resultMapping.setColumnName(columnName);
      resultMapping.setColumnIndex(1);
      resultMapping.setTypeHandler(getDelegate().getTypeHandlerFactory().getTypeHandler(getResultClass()));

      List resultMappingList = new ArrayList();
      resultMappingList.add(resultMapping);

      setResultMappingList(resultMappingList);

    } catch (SQLException e) {
      throw new RuntimeException("Error automapping columns. Cause: " + e);
    }
  }

}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产片一区二区| 7777精品伊人久久久大香线蕉的 | 99在线精品一区二区三区| 国产一区欧美二区| 国产精品久久久久久户外露出 | 欧美日韩免费观看一区二区三区| 国产精品久久久久影院色老大| 麻豆精品一二三| 欧美日韩精品综合在线| 亚洲一区二区综合| 色噜噜久久综合| ㊣最新国产の精品bt伙计久久| 91精品免费观看| 蜜桃在线一区二区三区| 欧美一区二区在线免费观看| 久久国产生活片100| 日韩午夜激情免费电影| 一区二区三区国产豹纹内裤在线| 欧美精品vⅰdeose4hd| 婷婷一区二区三区| 久久综合久久综合久久| 狠狠色丁香婷综合久久| 自拍偷拍亚洲激情| 色欧美片视频在线观看| 国产福利一区在线| av不卡免费电影| 色狠狠一区二区| 色婷婷综合激情| 51精品国自产在线| 欧洲一区二区三区免费视频| 国产一区在线看| 国内精品在线播放| 91在线一区二区三区| 成人免费三级在线| 精品亚洲国产成人av制服丝袜| 欧美日韩国产一区二区三区地区| 肉丝袜脚交视频一区二区| 欧美成人精品高清在线播放| 国产呦精品一区二区三区网站| 亚洲444eee在线观看| 欧美成人福利视频| 久久99精品一区二区三区| 国产女同互慰高潮91漫画| 91麻豆国产自产在线观看| 日本视频在线一区| 中文字幕第一区| 欧美色图在线观看| 国产精品99久久不卡二区| 伊人婷婷欧美激情| 精品国产乱码久久久久久久久| 99r国产精品| 麻豆精品视频在线观看免费| 欧美韩日一区二区三区四区| 欧美日韩一区 二区 三区 久久精品| 理论电影国产精品| 亚洲免费毛片网站| 久久看人人爽人人| 91麻豆精品国产自产在线观看一区| 久久99精品久久久久| 一区二区三区成人| 久久久久久久网| 欧美欧美欧美欧美首页| 91小视频免费看| 韩国视频一区二区| 亚洲gay无套男同| 久久尤物电影视频在线观看| 欧美图区在线视频| 成人免费高清在线| 美女视频一区二区三区| 亚洲五码中文字幕| 中文字幕一区三区| 欧美不卡激情三级在线观看| 欧美日韩视频在线第一区| 懂色av一区二区在线播放| 青青青伊人色综合久久| 亚洲国产日韩精品| 亚洲精品视频在线看| 久久久www免费人成精品| 91精品婷婷国产综合久久| 欧美亚洲国产一区二区三区va | 日韩激情一二三区| 国产精品色噜噜| 亚洲精品一线二线三线| 欧美日韩国产成人在线91| 一本色道久久综合狠狠躁的推荐| 国产在线精品国自产拍免费| 亚洲欧美欧美一区二区三区| 久久一区二区三区国产精品| 欧美视频完全免费看| 91在线观看高清| 国产剧情av麻豆香蕉精品| 成人在线综合网| 国产**成人网毛片九色 | 欧美一级欧美一级在线播放| 欧美在线一二三四区| 一本色道综合亚洲| 97se狠狠狠综合亚洲狠狠| 成人高清免费在线播放| 国产高清不卡二三区| 99精品久久久久久| 亚洲色大成网站www久久九九| 久久久99精品久久| 久久久精品tv| 久久久另类综合| 中文欧美字幕免费| 亚洲视频免费看| 亚洲免费观看在线视频| 亚洲国产视频直播| 日本欧美一区二区在线观看| 美腿丝袜亚洲三区| 经典一区二区三区| 成人精品一区二区三区四区| 国产精品99久久久| 成人午夜电影网站| 成人精品小蝌蚪| 欧美三级电影在线看| 欧美乱熟臀69xxxxxx| 日韩精品一区二区三区视频| 精品国产91洋老外米糕| 国产精品毛片久久久久久久| 亚洲日本丝袜连裤袜办公室| 亚洲午夜激情av| 久久99国产精品麻豆| 成人高清在线视频| 欧美日韩视频在线第一区| 26uuu另类欧美| 国产精品国产精品国产专区不蜜 | 欧美一区二视频| 久久久久成人黄色影片| 国产精品第一页第二页第三页| 亚洲日本青草视频在线怡红院| 视频一区免费在线观看| 国产麻豆日韩欧美久久| 91国偷自产一区二区使用方法| 欧美电影一区二区三区| 欧美韩日一区二区三区四区| 亚洲国产成人av| 国产毛片精品国产一区二区三区| 久久久午夜电影| 亚洲另类色综合网站| 奇米777欧美一区二区| 99视频国产精品| 91精品国产一区二区三区| 中文字幕在线不卡一区二区三区| 亚洲123区在线观看| 成人高清视频免费观看| 欧美亚洲综合久久| 久久日韩精品一区二区五区| 中文字幕一区三区| 蜜臀av性久久久久蜜臀aⅴ流畅| 国产99精品视频| 欧美一区二区三区免费观看视频 | jiyouzz国产精品久久| 欧美日韩精品欧美日韩精品一 | 性久久久久久久久| 国产精品99久久久久| 777a∨成人精品桃花网| 亚洲免费观看视频| 国产ts人妖一区二区| 日韩女优视频免费观看| 亚洲午夜在线视频| 色综合天天综合狠狠| 久久蜜臀精品av| 亚洲综合丁香婷婷六月香| 国产一区二区三区四区在线观看| 欧美日韩三级一区| 亚洲欧美综合另类在线卡通| 国产精品羞羞答答xxdd| 日韩欧美一区二区久久婷婷| 1024成人网色www| 另类专区欧美蜜桃臀第一页| 成人影视亚洲图片在线| 久久久久久久久久久电影| 日本vs亚洲vs韩国一区三区| 欧美丝袜自拍制服另类| 亚洲自拍与偷拍| 99国产精品一区| 18成人在线视频| 91尤物视频在线观看| 国产精品久久精品日日| 国产精品一区二区三区99| 精品国产91乱码一区二区三区 | 成人免费在线播放视频| 国产成人免费在线视频| 日韩欧美中文字幕公布| 日韩va欧美va亚洲va久久| 一本一道久久a久久精品 | 91.xcao| 亚洲高清免费在线| 欧美午夜片在线看| 亚洲国产精品一区二区久久 | 92精品国产成人观看免费| 亚洲视频免费观看| 中文字幕不卡在线播放| 成人夜色视频网站在线观看| 中文字幕第一区综合| 色综合久久99| 亚洲第一电影网| 欧美三区在线观看| 亚洲午夜精品17c|