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

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

?? resultobjectfactoryutil.java

?? 本套系統采用了業界當前最為流行的beanAction組件
?? JAVA
字號:
/*
 *  Copyright 2006 The Apache Software Foundation
 *
 *  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 java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.ibatis.common.resources.Resources;

/**
 * This class is used to create instances of result objects.  It will
 * use the configured ResultObjectFactory if there is one, otherwise
 * it will use iBATIS' normal methods.
 * 
 * Note that this class is somewhat tightly coupled with
 * SqlExecuter - SqlExecute must call the setStatementId() and
 * setResultObjectFactory() methods before executing a statement.
 * This is a result of using a ThreadLocal to hold the current
 * configuration for the statement under execution.  Using a
 * ThreadLocal is a solution for IBATIS-366.  Without a ThreadLocal,
 * the current factory and statement id would have to be added to 
 * many method signatures - often in inappropriate places.
 * 
 * @author Jeff Butler
 */
public class ResultObjectFactoryUtil {
  
  /**
   * Use a ThreadLocal to hold the current statementId and
   * factory.  This is much easier than passing these
   * items all over the place, and it has no measurable impact on
   * performance (I did a test with 100000 result rows and found
   * no impact - Jeff Butler).
   */
  private static ThreadLocal factorySettings = new ThreadLocal();
  
  /**
   * Utility class - no instances
   */
  private ResultObjectFactoryUtil() {
    super();
  }

  /**
   * Algorithm:
   * 
   * <ul>
   *   <li>If factory is null, then create object internally()</li>
   *   <li>Otherwise try to create object through factory</li>
   *   <li>If null returned from factory, then create object internally</li>
   * </ul>
   * 
   * This allows the factory to selectively create objects, also allows for
   * the common possibility that a factory is not configured.
   * 
   * @param factory
   *          the factory to use. May be null!
   * @param statementId
   *          the ID of the statement that generated the call to this method
   * @param clazz
   *          the type of object to create
   * @return a new instance of the specified class.  The instance must
   *   be castable to the specified class.
   * @throws InstantiationException
   *           if the instance cannot be created. If you throw this Exception,
   *           iBATIS will throw a runtime exception in response and will end.
   * @throws IllegalAccessException
   *           if the constructor cannot be accessed. If you throw this
   *           Exception, iBATIS will throw a runtime exception in response and
   *           will end.
   */
  public static Object createObjectThroughFactory(Class clazz) throws InstantiationException,
      IllegalAccessException {
    
    FactorySettings fs = getFactorySettings();
    
    Object obj;
    if (fs.getResultObjectFactory() == null) {
      obj = createObjectInternally(clazz);
    } else {
      obj = fs.getResultObjectFactory().createInstance(fs.getStatementId(), clazz);
      if (obj == null) {
        obj = createObjectInternally(clazz);
      }
    }
    
    return obj;
  }

  /**
   * This method creates object using iBATIS' normal mechanism.  We
   * translate List and Collection to ArrayList, and Set to HashSet
   * because these interfaces may be requested in nested resultMaps
   * and we want to supply default implementations.
   * 
   * @param clazz
   * @return
   * @throws InstantiationException
   * @throws IllegalAccessException
   */
  private static Object createObjectInternally(Class clazz) throws InstantiationException, IllegalAccessException {
    Class classToCreate;
    if (clazz == List.class || clazz == Collection.class) {
      classToCreate = ArrayList.class;
    } else if (clazz == Set.class) {
      classToCreate = HashSet.class;
    } else {
      classToCreate = clazz;
    }
    
    Object obj = Resources.instantiate(classToCreate);
    return obj;
  }
  
  public static void setResultObjectFactory(ResultObjectFactory resultObjectFactory) {
    getFactorySettings().setResultObjectFactory(resultObjectFactory);
  }
  
  public static void setStatementId(String statementId) {
    getFactorySettings().setStatementId(statementId);
  }
  
  private static FactorySettings getFactorySettings() {
    FactorySettings fs = (FactorySettings) factorySettings.get();
    if (fs == null) {
      fs = new FactorySettings();
      factorySettings.set(fs);
    }
    
    return fs;
  }
  
  private static class FactorySettings {
    private ResultObjectFactory resultObjectFactory;
    private String statementId;
    
    public ResultObjectFactory getResultObjectFactory() {
      return resultObjectFactory;
    }
    
    public void setResultObjectFactory(ResultObjectFactory resultObjectFactory) {
      this.resultObjectFactory = resultObjectFactory;
    }
    
    public String getStatementId() {
      return statementId;
    }
    
    public void setStatementId(String statementId) {
      this.statementId = statementId;
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区成人久久免费影院| 国产麻豆午夜三级精品| 国产三区在线成人av| 欧美在线啊v一区| 国产精品伊人色| 日韩中文字幕91| 国产精品卡一卡二| 久久久久国产精品厨房| 7777精品伊人久久久大香线蕉完整版 | 欧美一级午夜免费电影| 91年精品国产| 国产传媒一区在线| 日韩国产欧美视频| 亚洲一区在线观看免费| 久久久99久久精品欧美| 91麻豆精品国产91久久久久 | 亚洲一区二区av在线| 日本一区二区三级电影在线观看| 欧美精品久久一区二区三区| 91捆绑美女网站| 粉嫩av一区二区三区粉嫩| 麻豆国产欧美日韩综合精品二区| 亚洲精品成人少妇| 亚洲国产岛国毛片在线| 精品对白一区国产伦| 777亚洲妇女| 欧美在线看片a免费观看| 91麻豆精品秘密| 99精品久久只有精品| 成人性生交大合| 国产激情精品久久久第一区二区 | 亚洲欧美怡红院| 国产日韩欧美高清| 精品国产乱码91久久久久久网站| 制服丝袜中文字幕亚洲| 欧美日韩免费电影| 欧美日韩一区二区三区在线看| 色综合久久综合网97色综合| 99在线热播精品免费| 91丨九色丨蝌蚪丨老版| 99精品在线观看视频| 91麻豆免费视频| 在线免费观看日本欧美| 欧美曰成人黄网| 欧美日韩一本到| 欧美精品色综合| 日韩欧美一区二区不卡| 久久婷婷国产综合精品青草| 久久亚区不卡日本| 国产欧美日韩不卡免费| 中文字幕一区二区三区精华液| 国产精品乱码一区二三区小蝌蚪| 成人欧美一区二区三区在线播放| 亚洲欧美国产毛片在线| 亚洲国产人成综合网站| 天天色天天操综合| 精品一区二区三区香蕉蜜桃| 国产美女主播视频一区| 成人久久18免费网站麻豆| 在线亚洲人成电影网站色www| 在线视频综合导航| 欧美精品在欧美一区二区少妇| 日韩欧美高清在线| 久久久亚洲精华液精华液精华液| 国产午夜亚洲精品羞羞网站| 亚洲精品视频一区二区| 日本午夜一区二区| 国产成人午夜精品5599| 在线一区二区视频| 精品久久一二三区| 国产精品国产三级国产普通话蜜臀 | 国产中文字幕精品| 99久久国产综合色|国产精品| 日本精品一区二区三区四区的功能| 亚洲自拍偷拍av| 欧美嫩在线观看| 精品福利一区二区三区| 亚洲欧洲精品一区二区精品久久久| 亚洲免费大片在线观看| 蜜臀久久99精品久久久久宅男| 国产精品一二三| 欧美午夜精品理论片a级按摩| 欧美一级日韩免费不卡| 国产欧美1区2区3区| 亚洲永久精品大片| 韩国三级在线一区| 91蜜桃传媒精品久久久一区二区| 在线电影一区二区三区| 欧美国产乱子伦| 日韩国产欧美三级| 97se亚洲国产综合自在线不卡| 欧美电影在哪看比较好| 国产精品的网站| 久久精品久久99精品久久| 色综合一区二区三区| 精品美女一区二区| 亚洲无线码一区二区三区| 高清beeg欧美| 欧美一级片在线观看| 亚洲私人影院在线观看| 国产一区二区三区电影在线观看| 91久久免费观看| 中文字幕免费不卡在线| 另类调教123区| 在线观看国产精品网站| 国产精品视频一区二区三区不卡| 奇米777欧美一区二区| 色综合久久久久| 国产精品日产欧美久久久久| 久久精品国产亚洲aⅴ| 91福利精品视频| 国产精品国产三级国产aⅴ无密码| 狠狠狠色丁香婷婷综合激情| 欧美精品 日韩| 亚洲一区二区美女| 91在线一区二区三区| 国产女人aaa级久久久级| 久久99国产精品久久99果冻传媒| 欧美日韩国产经典色站一区二区三区| 中文一区在线播放| 国产精品亚洲а∨天堂免在线| 欧美一二三区在线观看| 同产精品九九九| 色综合久久久久| 亚洲三级在线看| 成人激情午夜影院| 国产精品嫩草影院av蜜臀| 国产精品亚洲专一区二区三区 | 日韩视频一区二区| 亚洲成人资源在线| 在线一区二区三区四区五区 | 99热99精品| 国产精品成人午夜| 99久久精品国产毛片| 中文字幕在线不卡国产视频| 成人福利视频网站| 国产精品的网站| 色综合咪咪久久| 亚洲一区二三区| 欧美日韩的一区二区| 日本系列欧美系列| 精品伦理精品一区| 国产成人免费视频网站高清观看视频| 久久久一区二区三区捆绑**| 粉嫩绯色av一区二区在线观看| 国产精品午夜电影| 91香蕉视频污| 亚洲.国产.中文慕字在线| 欧美一区二区啪啪| 国内精品国产三级国产a久久| 国产婷婷色一区二区三区四区| 国产成人免费视频一区| 亚洲男人电影天堂| 在线电影欧美成精品| 精品一区二区在线看| 国产精品入口麻豆九色| 色哟哟一区二区在线观看| 亚洲成人先锋电影| 精品国产露脸精彩对白| 国产aⅴ综合色| 亚洲欧洲在线观看av| 欧美性淫爽ww久久久久无| 奇米在线7777在线精品| 国产日韩三级在线| 日本久久电影网| 看国产成人h片视频| 国产精品每日更新在线播放网址 | 51久久夜色精品国产麻豆| 国产自产高清不卡| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧洲色大大久久| 国产美女娇喘av呻吟久久| 亚洲视频一区二区免费在线观看| 欧美日韩一区二区在线观看| 国产麻豆一精品一av一免费 | 欧美性生活一区| 极品少妇一区二区| 亚洲精品第1页| 日韩精品一区二区三区视频播放| 成人中文字幕合集| 婷婷成人综合网| 国产欧美一二三区| 欧美日韩dvd在线观看| 国产精华液一区二区三区| 亚洲二区在线视频| 国产女人18毛片水真多成人如厕| 欧美吞精做爰啪啪高潮| 国产一区二区三区精品欧美日韩一区二区三区| 亚洲色欲色欲www| 久久蜜臀中文字幕| 欧美福利视频一区| 99免费精品视频| 狠狠狠色丁香婷婷综合激情 | 亚洲欧美国产毛片在线| 久久久久久久久伊人| 欧美亚洲国产一区二区三区va| 国产99久久久国产精品潘金网站| 亚洲va韩国va欧美va| 最新久久zyz资源站| 欧美精品一区二区三区视频|