亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品一二三四区| 欧美精品一区二区三区在线 | 91色porny在线视频| 欧美午夜电影在线播放| 久久精品这里都是精品| 亚洲大片免费看| av高清不卡在线| 26uuu精品一区二区| 午夜精品久久久久影视| 成人av综合在线| 久久久久久一二三区| 亚洲成a人v欧美综合天堂| 国产精品99久久久久久似苏梦涵| 欧美二区三区的天堂| 亚洲精品日韩专区silk| 高清视频一区二区| 久久综合色一综合色88| 激情综合一区二区三区| 日韩美女视频一区二区在线观看| 亚洲成av人综合在线观看| 91国产免费观看| 悠悠色在线精品| www.亚洲人| 国产清纯白嫩初高生在线观看91 | 中文字幕亚洲一区二区va在线| 久久精品二区亚洲w码| 91超碰这里只有精品国产| 伊人一区二区三区| 99视频在线精品| 亚洲欧美激情插 | 亚洲午夜电影在线| 在线亚洲人成电影网站色www| 亚洲婷婷综合色高清在线| 波多野结衣在线一区| 国产精品免费人成网站| 成人国产精品视频| 亚洲视频资源在线| 色狠狠桃花综合| 亚洲一区二区欧美| 7777女厕盗摄久久久| 久久精品免费观看| 久久人人爽人人爽| 成人免费视频视频在线观看免费 | 懂色av一区二区三区免费观看| 久久久久久免费| 成人综合婷婷国产精品久久| 国产精品久久久久久久久晋中 | 在线成人免费观看| 免费成人在线观看| 久久精品一区二区三区不卡| 国产福利91精品| 亚洲图片激情小说| 777奇米四色成人影色区| 另类小说视频一区二区| 久久品道一品道久久精品| 波多野结衣精品在线| 亚洲国产日产av| 337p粉嫩大胆噜噜噜噜噜91av | 日韩三级精品电影久久久| 国产伦精品一区二区三区在线观看| 久久午夜免费电影| 91在线观看成人| 麻豆91精品视频| 国产精品二区一区二区aⅴ污介绍| 欧洲av在线精品| 激情av综合网| 亚洲一区精品在线| 久久九九久久九九| 欧美亚洲高清一区二区三区不卡| 久色婷婷小香蕉久久| 亚洲天堂网中文字| 欧美成人国产一区二区| 9l国产精品久久久久麻豆| 麻豆精品在线播放| 亚洲精品视频在线观看免费| 日韩女优av电影在线观看| 99国产精品99久久久久久| 国产一区日韩二区欧美三区| 中文字幕日本乱码精品影院| 欧美一区永久视频免费观看| 99久久99久久精品免费观看| 蜜桃av一区二区三区电影| 国产精品免费av| 日韩三级中文字幕| 欧美日韩国产精选| 不卡大黄网站免费看| 青草av.久久免费一区| 亚洲免费成人av| 久久精品视频免费| 69堂国产成人免费视频| 色综合久久久久久久久久久| 国产美女娇喘av呻吟久久| 日韩精品一二三| 一区二区三区在线看| 中文字幕一区二区三区精华液| 欧美一区二区三区视频| 欧美日韩亚洲综合在线| 91麻豆国产在线观看| 成人精品鲁一区一区二区| 国产一区二区三区国产| 蜜臀av一区二区| 午夜免费欧美电影| 亚洲国产另类精品专区| 亚洲男同1069视频| 成人免费在线观看入口| 国产日韩精品一区二区三区| 久久免费偷拍视频| 久久综合九色欧美综合狠狠| 日韩欧美色电影| 欧美日产在线观看| 在线91免费看| 日韩欧美一卡二卡| 欧美大胆一级视频| 精品国偷自产国产一区| 精品久久久久久久人人人人传媒| 91精品国产乱码| 日韩一区二区视频| 欧美成人一区二区| 久久综合给合久久狠狠狠97色69| 精品国产区一区| 久久看人人爽人人| 国产精品久久久久aaaa| 综合亚洲深深色噜噜狠狠网站| 中文字幕一区二区三区四区| 综合电影一区二区三区| 一区二区三区四区不卡在线 | 亚洲午夜一区二区| 午夜精品久久久久久不卡8050| 香蕉久久夜色精品国产使用方法| 日本成人在线一区| 国产一区二区主播在线| 国产不卡高清在线观看视频| 99在线精品一区二区三区| 欧洲亚洲精品在线| 日韩欧美国产综合| 国产精品人人做人人爽人人添| 亚洲丝袜精品丝袜在线| 五月婷婷色综合| 国内精品国产三级国产a久久| 成人免费毛片高清视频| 日本大香伊一区二区三区| 在线播放欧美女士性生活| 日韩欧美一卡二卡| 国内外成人在线视频| 国产成a人无v码亚洲福利| 99riav一区二区三区| 欧美电影在线免费观看| 久久精品亚洲麻豆av一区二区| 18成人在线视频| 日韩电影在线观看电影| 国产精品996| 欧美在线观看18| 久久久www成人免费无遮挡大片| 亚洲欧美色综合| 精品亚洲aⅴ乱码一区二区三区| www.欧美亚洲| 欧美一二三区在线观看| 中文一区在线播放| 日本美女一区二区| 91蜜桃在线免费视频| 欧美一区中文字幕| 亚洲免费色视频| 国产精品亚洲专一区二区三区| 欧美色图12p| 国产精品视频一区二区三区不卡| 有码一区二区三区| 国产成人精品一区二区三区四区 | 免费在线观看一区| 91麻豆免费在线观看| 国产午夜亚洲精品午夜鲁丝片| 亚洲电影中文字幕在线观看| 国产美女主播视频一区| 欧美美女一区二区三区| 一区在线中文字幕| 国产一区二区三区免费在线观看| 欧美无乱码久久久免费午夜一区| 日本一区二区三区在线不卡| 免费一级片91| 欧美三级欧美一级| 亚洲男人的天堂一区二区 | 中文字幕一区二区三区色视频| 麻豆精品国产传媒mv男同| 欧美在线一二三| 自拍视频在线观看一区二区| 国产福利一区二区三区视频在线| 日韩一区二区三区高清免费看看| 亚洲一级二级三级在线免费观看| 国产成人av电影在线观看| 精品剧情v国产在线观看在线| 亚洲成人手机在线| 欧美日韩中文一区| 亚洲丰满少妇videoshd| 欧美午夜一区二区三区| 亚洲欧美电影一区二区| 99视频超级精品| 亚洲欧美国产高清| 色拍拍在线精品视频8848| 中文字幕一区免费在线观看| 粉嫩嫩av羞羞动漫久久久 | 狠狠色丁香久久婷婷综合_中|