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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? sqlmapexecutordelegate.java

?? 本套系統(tǒng)采用了業(yè)界當(dāng)前最為流行的beanAction組件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號(hào):
/*
 *  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.impl;

import com.ibatis.common.beans.Probe;
import com.ibatis.common.beans.ProbeFactory;
import com.ibatis.common.jdbc.exception.NestedSQLException;
import com.ibatis.common.util.PaginatedList;
import com.ibatis.common.util.ThrottledPool;
import com.ibatis.sqlmap.client.SqlMapException;
import com.ibatis.sqlmap.client.event.RowHandler;
import com.ibatis.sqlmap.engine.cache.CacheKey;
import com.ibatis.sqlmap.engine.cache.CacheModel;
import com.ibatis.sqlmap.engine.exchange.DataExchangeFactory;
import com.ibatis.sqlmap.engine.execution.BatchException;
import com.ibatis.sqlmap.engine.execution.SqlExecutor;
import com.ibatis.sqlmap.engine.mapping.parameter.ParameterMap;
import com.ibatis.sqlmap.engine.mapping.result.ResultMap;
import com.ibatis.sqlmap.engine.mapping.result.ResultObjectFactory;
import com.ibatis.sqlmap.engine.mapping.statement.InsertStatement;
import com.ibatis.sqlmap.engine.mapping.statement.MappedStatement;
import com.ibatis.sqlmap.engine.mapping.statement.PaginatedDataList;
import com.ibatis.sqlmap.engine.mapping.statement.SelectKeyStatement;
import com.ibatis.sqlmap.engine.scope.RequestScope;
import com.ibatis.sqlmap.engine.scope.SessionScope;
import com.ibatis.sqlmap.engine.transaction.Transaction;
import com.ibatis.sqlmap.engine.transaction.TransactionException;
import com.ibatis.sqlmap.engine.transaction.TransactionManager;
import com.ibatis.sqlmap.engine.transaction.TransactionState;
import com.ibatis.sqlmap.engine.transaction.user.UserProvidedTransaction;
import com.ibatis.sqlmap.engine.type.TypeHandlerFactory;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

/**
 * The workhorse that really runs the SQL
 */
public class SqlMapExecutorDelegate {

  private static final Probe PROBE = ProbeFactory.getProbe();

  /**
   * The default maximum number of requests
   */
  public static final int DEFAULT_MAX_REQUESTS = 512;
  /**
   * The default maximum number of sessions
   */
  public static final int DEFAULT_MAX_SESSIONS = 128;
  /**
   * The default maximum number of transactions
   */
  public static final int DEFAULT_MAX_TRANSACTIONS = 32;

  private boolean lazyLoadingEnabled;
  private boolean cacheModelsEnabled;
  private boolean enhancementEnabled;

  private int maxRequests = DEFAULT_MAX_REQUESTS;
  private int maxSessions = DEFAULT_MAX_SESSIONS;
  private int maxTransactions = DEFAULT_MAX_TRANSACTIONS;

  private TransactionManager txManager;

  private HashMap mappedStatements;
  private HashMap cacheModels;
  private HashMap resultMaps;
  private HashMap parameterMaps;

  private ThrottledPool requestPool;
  private ThrottledPool sessionPool;

  protected SqlExecutor sqlExecutor;
  private TypeHandlerFactory typeHandlerFactory;
  private DataExchangeFactory dataExchangeFactory;
  
  private ResultObjectFactory resultObjectFactory;
  private boolean statementCacheEnabled;

  /**
   * Default constructor
   */
  public SqlMapExecutorDelegate() {
    mappedStatements = new HashMap();
    cacheModels = new HashMap();
    resultMaps = new HashMap();
    parameterMaps = new HashMap();

    requestPool = new ThrottledPool(RequestScope.class, DEFAULT_MAX_REQUESTS);
    sessionPool = new ThrottledPool(SessionScope.class, DEFAULT_MAX_SESSIONS);

    sqlExecutor = new SqlExecutor();
    typeHandlerFactory = new TypeHandlerFactory();
    dataExchangeFactory = new DataExchangeFactory(typeHandlerFactory);
  }

  /**
   * Getter for the DataExchangeFactory
   *
   * @return - the DataExchangeFactory
   */
  public DataExchangeFactory getDataExchangeFactory() {
    return dataExchangeFactory;
  }

  /**
   * Getter for the TypeHandlerFactory
   *
   * @return - the TypeHandlerFactory
   */
  public TypeHandlerFactory getTypeHandlerFactory() {
    return typeHandlerFactory;
  }

  /**
   * Getter for the status of lazy loading
   *
   * @return - the status
   */
  public boolean isLazyLoadingEnabled() {
    return lazyLoadingEnabled;
  }

  /**
   * Turn on or off lazy loading
   *
   * @param lazyLoadingEnabled - the new state of caching
   */
  public void setLazyLoadingEnabled(boolean lazyLoadingEnabled) {
    this.lazyLoadingEnabled = lazyLoadingEnabled;
  }

  /**
   * Getter for the status of caching
   *
   * @return - the status
   */
  public boolean isCacheModelsEnabled() {
    return cacheModelsEnabled;
  }

  /**
   * Turn on or off caching
   *
   * @param cacheModelsEnabled - the new state of caching
   */
  public void setCacheModelsEnabled(boolean cacheModelsEnabled) {
    this.cacheModelsEnabled = cacheModelsEnabled;
  }

  /**
   * Getter for the status of CGLib enhancements
   *
   * @return - the status
   */
  public boolean isEnhancementEnabled() {
    return enhancementEnabled;
  }

  /**
   * Turn on or off CGLib enhancements
   *
   * @param enhancementEnabled - the new state
   */
  public void setEnhancementEnabled(boolean enhancementEnabled) {
    this.enhancementEnabled = enhancementEnabled;
  }

  /**
   * Getter for the maximum number of requests
   *
   * @return - the maximum number of requests
   */
  public int getMaxRequests() {
    return maxRequests;
  }

  /**
   * Setter for the maximum number of requests
   *
   * @param maxRequests - the maximum number of requests
   */
  public void setMaxRequests(int maxRequests) {
    this.maxRequests = maxRequests;
    requestPool = new ThrottledPool(RequestScope.class, maxRequests);
  }

  /**
   * Getter for the maximum number of sessions
   *
   * @return - the maximum number of sessions
   */
  public int getMaxSessions() {
    return maxSessions;
  }

  /**
   * Setter for the maximum number of sessions
   *
   * @param maxSessions - the maximum number of sessions
   */
  public void setMaxSessions(int maxSessions) {
    this.maxSessions = maxSessions;
    this.sessionPool = new ThrottledPool(SessionScope.class, maxSessions);
  }

  /**
   * Getter for the the maximum number of transactions
   *
   * @return - the maximum number of transactions
   */
  public int getMaxTransactions() {
    return maxTransactions;
  }

  /**
   * Setter for the maximum number of transactions
   *
   * @param maxTransactions - the maximum number of transactions
   */
  public void setMaxTransactions(int maxTransactions) {
    this.maxTransactions = maxTransactions;
  }

  /**
   * Getter for the transaction manager
   *
   * @return - the transaction manager
   */
  public TransactionManager getTxManager() {
    return txManager;
  }

  /**
   * Setter for the transaction manager
   *
   * @param txManager - the transaction manager
   */
  public void setTxManager(TransactionManager txManager) {
    this.txManager = txManager;
  }

  /**
   * Add a mapped statement
   *
   * @param ms - the mapped statement to add
   */
  public void addMappedStatement(MappedStatement ms) {
    if (mappedStatements.containsKey(ms.getId())) {
      throw new SqlMapException("There is already a statement named " + ms.getId() + " in this SqlMap.");
    }
    ms.setBaseCacheKey(hashCode());
    mappedStatements.put(ms.getId(), ms);
  }

  /**
   * Get an iterator of the mapped statements
   *
   * @return - the iterator
   */
  public Iterator getMappedStatementNames() {
    return mappedStatements.keySet().iterator();
  }

  /**
   * Get a mappedstatement by its ID
   *
   * @param id - the statement ID
   * @return - the mapped statement
   */
  public MappedStatement getMappedStatement(String id) {
    MappedStatement ms = (MappedStatement) mappedStatements.get(id);
    if (ms == null) {
      throw new SqlMapException("There is no statement named " + id + " in this SqlMap.");
    }
    return ms;
  }

  /**
   * Add a cache model
   *
   * @param model - the model to add
   */
  public void addCacheModel(CacheModel model) {
    cacheModels.put(model.getId(), model);
  }

  /**
   * Get an iterator of the cache models
   *
   * @return - the cache models
   */
  public Iterator getCacheModelNames() {
    return cacheModels.keySet().iterator();
  }

  /**
   * Get a cache model by ID
   *
   * @param id - the ID
   * @return - the cache model
   */
  public CacheModel getCacheModel(String id) {
    CacheModel model = (CacheModel) cacheModels.get(id);
    if (model == null) {
      throw new SqlMapException("There is no cache model named " + id + " in this SqlMap.");
    }
    return model;
  }

  /**
   * Add a result map
   *
   * @param map - the result map to add
   */
  public void addResultMap(ResultMap map) {
    resultMaps.put(map.getId(), map);
  }

  /**
   * Get an iterator of the result maps
   *
   * @return - the result maps
   */
  public Iterator getResultMapNames() {
    return resultMaps.keySet().iterator();
  }

  /**
   * Get a result map by ID
   *
   * @param id - the ID
   * @return - the result map
   */
  public ResultMap getResultMap(String id) {
    ResultMap map = (ResultMap) resultMaps.get(id);
    if (map == null) {
      throw new SqlMapException("There is no result map named " + id + " in this SqlMap.");
    }
    return map;
  }

  /**
   * Add a parameter map
   *
   * @param map - the map to add
   */
  public void addParameterMap(ParameterMap map) {
    parameterMaps.put(map.getId(), map);
  }

  /**
   * Get an iterator of all of the parameter maps
   *
   * @return - the parameter maps
   */
  public Iterator getParameterMapNames() {
    return parameterMaps.keySet().iterator();
  }

  /**
   * Get a parameter map by ID
   *
   * @param id - the ID
   * @return - the parameter map
   */
  public ParameterMap getParameterMap(String id) {
    ParameterMap map = (ParameterMap) parameterMaps.get(id);
    if (map == null) {
      throw new SqlMapException("There is no parameter map named " + id + " in this SqlMap.");
    }
    return map;
  }

  /**
   * Flush all of the data caches
   */
  public void flushDataCache() {
    Iterator models = cacheModels.values().iterator();
    while (models.hasNext()) {
      ((CacheModel) models.next()).flush();
    }
  }

  /**
   * Flush a single cache by ID
   *
   * @param id - the ID
   */
  public void flushDataCache(String id) {
    CacheModel model = getCacheModel(id);
    if (model != null) {
      model.flush();
    }
  }

  //-- Basic Methods
  /**
   * Call an insert statement by ID
   *
   * @param session - the session
   * @param id      - the statement ID
   * @param param   - the parameter object
   * @return - the generated key (or null)
   * @throws SQLException - if the insert fails
   */
  public Object insert(SessionScope session, String id, Object param) throws SQLException {
    Object generatedKey = null;

    MappedStatement ms = getMappedStatement(id);
    Transaction trans = getTransaction(session);
    boolean autoStart = trans == null;

    try {
      trans = autoStartTransaction(session, autoStart, trans);

      SelectKeyStatement selectKeyStatement = null;
      if (ms instanceof InsertStatement) {
        selectKeyStatement = ((InsertStatement) ms).getSelectKeyStatement();
      }

      if (selectKeyStatement != null && !selectKeyStatement.isAfter()) {
        generatedKey = executeSelectKey(session, trans, ms, param);
      }

      RequestScope request = popRequest(session, ms);
      try {
        ms.executeUpdate(request, trans, param);
      } finally {
        pushRequest(request);
      }

      if (selectKeyStatement != null && selectKeyStatement.isAfter()) {
        generatedKey = executeSelectKey(session, trans, ms, param);
      }

      autoCommitTransaction(session, autoStart);
    } finally {
      autoEndTransaction(session, autoStart);
    }

    return generatedKey;
  }

  private Object executeSelectKey(SessionScope session, Transaction trans, MappedStatement ms, Object param) throws SQLException {
    Object generatedKey = null;
    RequestScope request;
    InsertStatement insert = (InsertStatement) ms;
    SelectKeyStatement selectKeyStatement = insert.getSelectKeyStatement();
    if (selectKeyStatement != null) {
      request = popRequest(session, selectKeyStatement);
      try {
        generatedKey = selectKeyStatement.executeQueryForObject(request, trans, param, null);
        String keyProp = selectKeyStatement.getKeyProperty();
        if (keyProp != null) {
          PROBE.setObject(param, keyProp, generatedKey);
        }
      } finally {
        pushRequest(request);
      }

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
人人狠狠综合久久亚洲| 日韩高清在线观看| 国产麻豆欧美日韩一区| 国产欧美一区二区精品秋霞影院 | 亚洲国产欧美日韩另类综合| 色哟哟国产精品免费观看| 亚洲成人精品影院| 国产日本欧美一区二区| 99久久精品免费| 日本不卡123| 中文字幕综合网| 欧美va亚洲va| 99这里只有精品| 九九精品视频在线看| 亚洲一区二区三区四区五区黄| 精品久久久久香蕉网| 国产乱码精品一区二区三区av | 国产丝袜在线精品| 欧美日韩高清一区二区不卡| 美女视频网站黄色亚洲| 欧美激情一区二区在线| 欧美日韩不卡一区| 日韩一区二区三区免费观看| 成人黄动漫网站免费app| 国产在线不卡视频| 另类调教123区| 奇米四色…亚洲| 午夜精彩视频在线观看不卡| 亚洲精品菠萝久久久久久久| 国产精品白丝在线| 国产精品久久久久久久裸模| 国产女人水真多18毛片18精品视频| 日韩小视频在线观看专区| 欧美日韩一区精品| 欧美日韩一区 二区 三区 久久精品| 91网站视频在线观看| av一区二区久久| 色综合天天性综合| 99re视频这里只有精品| 91亚洲精品乱码久久久久久蜜桃| 丁香婷婷综合激情五月色| 国产精品99久久久久久久女警| 国产一区欧美一区| 国产精品一品视频| 高清不卡一二三区| 99精品在线免费| 色婷婷av一区二区三区大白胸| 色综合网站在线| 欧洲精品一区二区三区在线观看| 欧美色窝79yyyycom| 在线播放日韩导航| 精品日韩欧美在线| 国产视频一区在线播放| 欧美国产精品专区| 亚洲欧美激情视频在线观看一区二区三区| 国产精品久久久久久久久免费桃花 | 国产欧美视频一区二区| 中文一区在线播放| 亚洲制服丝袜一区| 日韩不卡在线观看日韩不卡视频| 蜜桃视频在线观看一区| 国产福利电影一区二区三区| 91免费版在线看| 欧美精品丝袜久久久中文字幕| 欧美成人免费网站| 国产精品久久久久影院亚瑟| 亚洲一区二区三区中文字幕在线| 五月天一区二区| 国产精品一卡二卡在线观看| 99精品久久99久久久久| 7777精品伊人久久久大香线蕉完整版 | 欧美私模裸体表演在线观看| 91麻豆精品国产无毒不卡在线观看| 337p日本欧洲亚洲大胆色噜噜| 国产精品美女久久久久aⅴ| 一区二区三区四区精品在线视频| 日韩精品一级中文字幕精品视频免费观看 | 亚洲天堂久久久久久久| 午夜精品福利一区二区三区av | 精品一区二区三区免费毛片爱| 亚洲午夜精品在线| 国内一区二区视频| 色8久久人人97超碰香蕉987| 日韩亚洲欧美成人一区| 国产精品成人午夜| 麻豆国产精品一区二区三区| a亚洲天堂av| 欧美大片拔萝卜| 亚洲人精品午夜| 精久久久久久久久久久| 在线日韩av片| 国产亚洲精品超碰| 日韩精品一二三区| 91免费视频网| 精品国产乱码久久| 五月天亚洲精品| fc2成人免费人成在线观看播放| 在线不卡中文字幕| 亚洲欧美色图小说| 粉嫩av亚洲一区二区图片| 9191国产精品| 亚洲综合色丁香婷婷六月图片| 国产一区二区三区久久悠悠色av| 日本韩国精品在线| 亚洲国产精品成人综合| 美腿丝袜在线亚洲一区| 91福利区一区二区三区| 欧美国产精品一区| 久久99精品国产麻豆婷婷洗澡| 欧美日韩精品一区二区| 亚洲精品日产精品乱码不卡| 国产91在线|亚洲| 精品久久久三级丝袜| 日韩国产在线一| 在线观看视频一区二区| 国产精品久久久久久久久免费丝袜| 精品一区在线看| 日韩女优av电影| 日韩国产精品久久久| 欧美视频完全免费看| 亚洲色图制服诱惑| 99视频超级精品| 国产精品入口麻豆九色| 国产在线播放一区| 欧美成人国产一区二区| 久久精品国产一区二区三区免费看 | 欧美经典一区二区| 国产成人午夜99999| 久久这里只有精品视频网| 美腿丝袜亚洲三区| 欧美一区二区三区视频在线| 午夜精品影院在线观看| 欧美群妇大交群的观看方式| 亚洲福利视频三区| 欧美日韩一区二区三区免费看| 一区二区三区中文字幕电影| 91成人看片片| 亚洲一区二区三区在线| 欧美久久久久中文字幕| 亚洲第一二三四区| 777午夜精品视频在线播放| 日韩成人午夜电影| 精品美女在线播放| 国产一区二区三区| 中文av一区特黄| 91网站最新网址| 亚洲成人免费电影| 日韩欧美一区在线观看| 狠狠色综合日日| 久久久久久久久久看片| 成人黄色在线看| 樱花草国产18久久久久| 欧美日韩国产高清一区二区三区 | 一区二区三区不卡视频| 91久久免费观看| 日韩国产欧美三级| 久久影院午夜论| 豆国产96在线|亚洲| 亚洲激情在线播放| 欧美日本精品一区二区三区| 玖玖九九国产精品| 国产精品日韩精品欧美在线| 91久久线看在观草草青青| 日本欧美在线观看| 国产女主播在线一区二区| 99这里都是精品| 日韩影视精彩在线| 国产色婷婷亚洲99精品小说| 99久久久国产精品| 天天av天天翘天天综合网| 久久在线观看免费| 色婷婷综合久久久| 玖玖九九国产精品| 亚洲精品高清在线| 日韩久久久久久| 91免费视频观看| 国内成+人亚洲+欧美+综合在线| 中文字幕一区av| 日韩欧美国产一二三区| 白白色 亚洲乱淫| 日韩电影免费一区| 亚洲欧洲日韩一区二区三区| 欧美乱熟臀69xxxxxx| 国产夫妻精品视频| 午夜精品久久久久久久久| 欧美国产成人精品| 91精品黄色片免费大全| 成年人网站91| 久久精品国产久精国产| 亚洲男女一区二区三区| 久久免费美女视频| 欧美视频一区二区在线观看| 国产成人av网站| 免费人成在线不卡| 一级做a爱片久久| 欧美国产精品久久| 26uuu久久天堂性欧美| 欧美视频中文一区二区三区在线观看| 国产麻豆精品95视频| 亚洲bt欧美bt精品777|