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

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

?? sqlmapexecutordelegate.java

?? 本套系統采用了業界當前最為流行的beanAction組件
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/*
 *  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);
      }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩美一区二区三区| 精品一区中文字幕| 国产成人精品综合在线观看| 欧美国产精品专区| 婷婷亚洲久悠悠色悠在线播放| 色婷婷av一区二区三区大白胸| 日韩av在线发布| 日韩精品电影在线| 93久久精品日日躁夜夜躁欧美| 久久成人久久爱| 欧美国产精品v| 欧美成人性战久久| 色综合久久88色综合天天 | 欧美精品一区二区三区蜜桃视频| 国产91丝袜在线播放| 石原莉奈在线亚洲二区| 国产精品蜜臀av| 久久免费视频一区| 国产精品福利一区| 国产精品99久久久久久久女警 | 视频一区欧美日韩| 激情另类小说区图片区视频区| 麻豆91在线播放免费| 成人午夜私人影院| 欧美美女激情18p| 精品国产乱码久久久久久牛牛 | av电影天堂一区二区在线| 亚洲一区二区三区四区在线| 一区二区三区蜜桃| 亚洲午夜久久久久久久久电影网 | 91影院在线免费观看| 91精品国产综合久久香蕉的特点 | 亚洲国产一区二区三区青草影视| 国产片一区二区三区| 一区二区高清在线| 国产精品自拍三区| 久久这里只有精品首页| 色婷婷综合久久久中文字幕| proumb性欧美在线观看| 成人激情免费网站| 99国产精品99久久久久久| av在线综合网| 日本韩国精品一区二区在线观看| 欧美日韩三级一区| 久久久综合视频| 亚洲欧美日韩小说| 免费人成在线不卡| 成人综合婷婷国产精品久久蜜臀| 国产乱码精品1区2区3区| 日韩一区中文字幕| 免费三级欧美电影| 成人一级黄色片| 日韩精品一区二区三区中文精品| 国产女主播视频一区二区| 一区二区久久久久| 成人精品视频.| 欧美妇女性影城| 亚洲女与黑人做爰| 狠狠色丁香久久婷婷综| 欧美三级中文字| 欧美国产欧美综合| 国产在线一区观看| 日韩视频免费观看高清完整版在线观看 | 欧美一区二区三区视频在线观看| 久久久久国产精品厨房| 日本成人在线视频网站| 91在线丨porny丨国产| 久久久久亚洲蜜桃| 极品美女销魂一区二区三区| 欧美日韩亚洲综合一区| 亚洲日本一区二区| 成年人国产精品| 国产精品免费视频网站| 国产一区二区三区观看| 精品蜜桃在线看| 国产精品综合二区| 国产欧美精品一区二区色综合朱莉| 青青草原综合久久大伊人精品| 欧美日韩欧美一区二区| 午夜精品久久久久久久久| 日韩一级视频免费观看在线| 欧美天天综合网| 五月综合激情婷婷六月色窝| 制服丝袜在线91| 美女性感视频久久| 中文字幕欧美日韩一区| 色诱视频网站一区| 性感美女极品91精品| 91精品国产欧美日韩| 国产另类ts人妖一区二区| 久久精品夜夜夜夜久久| 欧美丝袜自拍制服另类| 国产真实乱子伦精品视频| 国产精品久久久久久久久免费相片| 色婷婷狠狠综合| 色综合久久综合网欧美综合网| 国产精品福利影院| 99久久精品一区二区| 亚洲成人一区在线| 不卡av在线免费观看| 奇米色一区二区| 日本高清无吗v一区| 一区二区三区四区激情| 日韩视频一区二区三区在线播放| 在线影视一区二区三区| 爽爽淫人综合网网站| 26uuu精品一区二区三区四区在线| 粉嫩aⅴ一区二区三区四区五区| 亚洲精品视频一区二区| 在线观看一区二区精品视频| 国产精品一区二区视频| 337p粉嫩大胆噜噜噜噜噜91av| 图片区小说区国产精品视频| 88在线观看91蜜桃国自产| 在线观看国产精品网站| 成人av在线看| www.日韩av| 26uuu亚洲综合色欧美| 麻豆国产一区二区| 97精品久久久午夜一区二区三区| 99久久精品免费精品国产| 婷婷国产v国产偷v亚洲高清| 一区二区免费视频| 国产精品久久久久7777按摩| 91麻豆精品国产无毒不卡在线观看| 国产一区二区美女| 日韩国产高清影视| 日本精品一级二级| 久久精品欧美一区二区三区麻豆| 欧美日韩国产一级片| 欧美性猛片aaaaaaa做受| 国产成a人无v码亚洲福利| 久草精品在线观看| 成人免费视频视频在线观看免费| 亚洲一区二区三区四区的 | 亚洲精品国产a| 一区二区三区自拍| 亚洲观看高清完整版在线观看| 国产精品免费视频网站| 18欧美亚洲精品| 亚洲电影中文字幕在线观看| 成人午夜视频福利| 北条麻妃一区二区三区| 欧美日韩一级二级| 五月天网站亚洲| 成人av在线电影| 欧美亚洲高清一区二区三区不卡| 在线亚洲一区观看| 日韩视频免费观看高清完整版在线观看| 欧美变态口味重另类| 国产欧美一区二区在线| 亚洲欧美激情小说另类| 日韩主播视频在线| 成人精品在线视频观看| 欧美日韩成人综合| 国产亚洲成av人在线观看导航| 亚洲人成小说网站色在线| 日本在线不卡视频| 91亚洲精品一区二区乱码| 欧美久久久影院| 国产精品伦理一区二区| 亚洲动漫第一页| 成人的网站免费观看| 欧美一区二区日韩一区二区| 中文字幕在线一区免费| 男女男精品网站| 在线亚洲+欧美+日本专区| 久久综合色8888| 日日摸夜夜添夜夜添国产精品 | 亚洲精品国产一区二区精华液| 日本不卡高清视频| 一本大道久久a久久综合| 精品欧美黑人一区二区三区| 亚洲国产综合91精品麻豆| 国产91高潮流白浆在线麻豆| 91精品国产综合久久精品性色| 国产精品每日更新在线播放网址 | 日本欧美一区二区三区乱码| ㊣最新国产の精品bt伙计久久| 精品在线亚洲视频| 欧美日韩国产高清一区二区| 综合精品久久久| 国产成人欧美日韩在线电影| 91精品国产色综合久久不卡蜜臀 | 91.xcao| 亚洲综合免费观看高清完整版在线| 国产成人在线网站| 精品国产精品一区二区夜夜嗨 | 亚洲主播在线观看| 色偷偷久久一区二区三区| 国产精品久久久久久久久果冻传媒| 久久精品国产99| 欧美sm极限捆绑bd| 久久精品99国产国产精| 欧美精品久久一区| 日韩极品在线观看| 在线综合亚洲欧美在线视频| 日韩专区一卡二卡| 日韩美女一区二区三区四区| 免费成人在线观看|