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

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

?? basicresultmap.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.mapping.result;

import com.ibatis.common.beans.Probe;
import com.ibatis.common.beans.ProbeFactory;
import com.ibatis.common.jdbc.exception.NestedSQLException;

import com.ibatis.sqlmap.client.SqlMapException;
import com.ibatis.sqlmap.engine.exchange.DataExchange;
import com.ibatis.sqlmap.engine.impl.ExtendedSqlMapClient;
import com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate;
import com.ibatis.sqlmap.engine.mapping.result.loader.ResultLoader;
import com.ibatis.sqlmap.engine.mapping.sql.Sql;
import com.ibatis.sqlmap.engine.mapping.statement.MappedStatement;
import com.ibatis.sqlmap.engine.scope.ErrorContext;
import com.ibatis.sqlmap.engine.scope.RequestScope;
import com.ibatis.sqlmap.engine.type.DomCollectionTypeMarker;
import com.ibatis.sqlmap.engine.type.DomTypeMarker;
import com.ibatis.sqlmap.engine.type.TypeHandler;
import com.ibatis.sqlmap.engine.type.TypeHandlerFactory;
import org.w3c.dom.Document;

import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.StringTokenizer;

/**
 * Basic implementation of ResultMap interface
 */
public class BasicResultMap implements ResultMap {

  private static final Probe PROBE = ProbeFactory.getProbe();
  private static final String KEY_SEPARATOR = "\002";

  private String id;
  private Class resultClass;

  // DO NOT ACCESS EITHER OF THESE OUTSIDE OF THEIR BEAN GETTER/SETTER
  private ResultMapping[] resultMappings;
  private ThreadLocal remappableResultMappings = new ThreadLocal();

  private DataExchange dataExchange;

  private List nestedResultMappings;

  private Discriminator discriminator;

  private Set groupByProps;

  private String xmlName;

  private String resource;

  private SqlMapExecutorDelegate delegate;

  protected boolean allowRemapping = false;

  /**
   * Constructor to pass a SqlMapExecutorDelegate in
   *
   * @param delegate - the SqlMapExecutorDelegate
   */
  public BasicResultMap(SqlMapExecutorDelegate delegate) {
    this.delegate = delegate;
  }

  /**
   * Getter for the SqlMapExecutorDelegate
   *
   * @return - the delegate
   */
  public SqlMapExecutorDelegate getDelegate() {
    return delegate;
  }

  public String getId() {
    return id;
  }

  /**
   * Setter for the ID
   *
   * @param id - the new ID
   */
  public void setId(String id) {
    this.id = id;
  }

  public Class getResultClass() {
    return resultClass;
  }

  public Object getUniqueKey(String keyPrefix, Object[] values) {
    if (groupByProps != null) {
      StringBuffer keyBuffer;
      if ( keyPrefix != null ) keyBuffer = new StringBuffer(keyPrefix);
      else keyBuffer = new StringBuffer();
      for (int i = 0; i < getResultMappings().length; i++) {
        String propertyName = getResultMappings()[i].getPropertyName();
        if (groupByProps.contains(propertyName)) {
          keyBuffer.append(values[i]);
          keyBuffer.append('-');
        }
      }
      if (keyBuffer.length() < 1) {
        return null;
      } else {
      	// seperator value not likely to appear in a database
      	keyBuffer.append(KEY_SEPARATOR);
        return keyBuffer.toString();
      }
    } else {
      return null;
    }
  }

  public Object getUniqueKey(Object[] values) {
  	return getUniqueKey(null, values);
  }

  /**
   * Setter for the result class (what the results will be mapped into)
   *
   * @param resultClass - the result class
   */
  public void setResultClass(Class resultClass) {
    this.resultClass = resultClass;
  }

  /**
   * Getter for the DataExchange object to be used
   *
   * @return - the DataExchange object
   */
  public DataExchange getDataExchange() {
    return dataExchange;
  }

  /**
   * Setter for the DataExchange object to be used
   *
   * @param dataExchange - the new DataExchange object
   */
  public void setDataExchange(DataExchange dataExchange) {
    this.dataExchange = dataExchange;
  }

  /**
   * Getter (used by DomDataExchange) for the xml name of the results
   *
   * @return - the name
   */
  public String getXmlName() {
    return xmlName;
  }

  /**
   * Setter (used by the SqlMapBuilder) for the xml name of the results
   *
   * @param xmlName - the name
   */
  public void setXmlName(String xmlName) {
    this.xmlName = xmlName;
  }

  /**
   * Getter for the resource (used to report errors)
   *
   * @return - the resource
   */
  public String getResource() {
    return resource;
  }

  /**
   * Setter for the resource (used by the SqlMapBuilder)
   *
   * @param resource - the resource name
   */
  public void setResource(String resource) {
    this.resource = resource;
  }

  public void addGroupByProperty(String name) {
    if (groupByProps == null) {
      groupByProps = new HashSet();
    }
    groupByProps.add(name);
  }

  public boolean hasGroupBy() {
    return groupByProps != null && groupByProps.size() > 0;
  }

  public Iterator groupByProps() {
    return groupByProps.iterator();
  }

  public void addNestedResultMappings(ResultMapping mapping) {
    if (nestedResultMappings == null) {
      nestedResultMappings = new ArrayList();
    }
    nestedResultMappings.add(mapping);
  }

  public List getNestedResultMappings() {
    return nestedResultMappings;
  }
  
  public ResultMapping[] getResultMappings() {
    if (allowRemapping) {
      return (ResultMapping[]) remappableResultMappings.get();
    } else {
      return resultMappings;
    }
  }

  public void setDiscriminator (Discriminator discriminator) {
    if (this.discriminator != null) {
      throw new SqlMapException ("A discriminator may only be set once per result map.");
    }
    this.discriminator = discriminator;
  }

  public Discriminator getDiscriminator() {
    return discriminator;
  }

  public ResultMap resolveSubMap (RequestScope request, ResultSet rs) throws SQLException {
    ResultMap subMap = this;
    if (discriminator != null) {
      BasicResultMapping mapping = (BasicResultMapping)discriminator.getResultMapping();
      Object value = getPrimitiveResultMappingValue(rs, mapping);
      if (value == null) {
        value = doNullMapping(value, mapping);
      }
      subMap = discriminator.getSubMap(String.valueOf(value));
      if (subMap == null) {
        subMap = this;
      } else if (subMap != this) {
        subMap = subMap.resolveSubMap(request, rs);
      }
    }
    return subMap;
  }

  /**
   * Setter for a list of the individual ResultMapping objects
   *
   * @param resultMappingList - the list
   */
  public void setResultMappingList(List resultMappingList) {
    if (allowRemapping) {
      this.remappableResultMappings.set((BasicResultMapping[]) resultMappingList.toArray(new BasicResultMapping[resultMappingList.size()]));
    } else {
      this.resultMappings = (BasicResultMapping[]) resultMappingList.toArray(new BasicResultMapping[resultMappingList.size()]);
    }


    Map props = new HashMap();
    props.put("map", this);
    dataExchange = getDelegate().getDataExchangeFactory().getDataExchangeForClass(resultClass);
    dataExchange.initialize(props);
  }

  /**
   * Getter for the number of ResultMapping objects
   *
   * @return - the count
   */
  public int getResultCount() {
    return this.getResultMappings().length;
  }

  /**
   * Read a row from a resultset and map results to an array.
   *
   * @param request scope of the request
   * @param rs ResultSet to read from
   *
   * @return row read as an array of column values.
   *
   * @throws java.sql.SQLException
   */
  public Object[] getResults(RequestScope request, ResultSet rs)
      throws SQLException {
    ErrorContext errorContext = request.getErrorContext();
    errorContext.setActivity("applying a result map");
    errorContext.setObjectId(this.getId());
    errorContext.setResource(this.getResource());
    errorContext.setMoreInfo("Check the result map.");

    boolean foundData = false;
    Object[] columnValues = new Object[getResultMappings().length];

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩写真欧美这视频| 亚洲免费观看高清完整版在线| 国产成人综合在线观看| av午夜精品一区二区三区| 国产电影精品久久禁18| 欧美日韩国产片| 国产精品色婷婷久久58| 日本欧美久久久久免费播放网| 图片区小说区区亚洲影院| 国产成人精品免费一区二区| 欧美精品aⅴ在线视频| 成人欧美一区二区三区| 激情综合网av| 国产经典欧美精品| 成人午夜电影小说| 色网站国产精品| 欧美三级电影在线看| 中文字幕欧美日本乱码一线二线| 国产精品五月天| 狠狠色狠狠色综合| 欧美放荡的少妇| 亚洲国产视频一区二区| 色综合久久久久| 中文字幕日韩一区| 成人高清伦理免费影院在线观看| 97精品国产97久久久久久久久久久久| 91在线视频18| 国产欧美一区二区精品性色超碰| 中文字幕在线播放不卡一区| 亚洲一区二区三区小说| 成人av在线电影| 欧美男女性生活在线直播观看| 欧美一区二区三区视频在线| 午夜成人免费电影| 欧美日韩午夜精品| 亚洲高清一区二区三区| 欧美三级电影精品| 日一区二区三区| 欧美日韩一二区| 亚洲超碰97人人做人人爱| 精品影视av免费| 91高清在线观看| 亚洲夂夂婷婷色拍ww47| 在线视频你懂得一区| 日韩女同互慰一区二区| 精品一区在线看| 日韩激情av在线| 日韩午夜在线影院| 精品一区二区三区视频在线观看| 色诱视频网站一区| 亚洲一二三区不卡| 日韩一区二区在线看| 国产在线日韩欧美| 欧美剧在线免费观看网站| 爽爽淫人综合网网站| 欧美成人一区二区| 国产一级精品在线| 亚洲人亚洲人成电影网站色| 久久99久久99精品免视看婷婷| 一本久久a久久精品亚洲| 国产日韩欧美a| 一本到不卡免费一区二区| 日韩欧美123| 免费的国产精品| 久久精品一区二区三区av| 成人福利在线看| 国产女人aaa级久久久级| 蜜桃av一区二区三区| 久久精品一区二区三区不卡牛牛| 麻豆freexxxx性91精品| 国产精品天美传媒| 欧美日韩激情一区二区三区| 韩国在线一区二区| 一区二区三区在线看| 日韩亚洲欧美成人一区| 日本在线不卡视频| 国产欧美在线观看一区| 欧美精品18+| 成人国产在线观看| 久久精品国产澳门| 亚洲激情av在线| 91丝袜高跟美女视频| 免费三级欧美电影| 一区二区三区日韩精品视频| 欧美成人一区二区三区| 日本高清不卡aⅴ免费网站| 国产一区二区三区黄视频| 亚洲福利一区二区| 国产精品久久久久久久浪潮网站| 粉嫩欧美一区二区三区高清影视| 久久先锋影音av鲁色资源网| 精品一区二区免费视频| 亚洲一二三区不卡| 中文字幕亚洲区| 久久综合九色综合97婷婷| 国产乱人伦偷精品视频免下载| 久久久欧美精品sm网站| 欧美另类z0zxhd电影| 色综合久久久久网| 风间由美一区二区三区在线观看| 欧美韩国一区二区| 久久伊人中文字幕| 日韩三级视频在线看| 欧美三电影在线| 一本在线高清不卡dvd| 国产.精品.日韩.另类.中文.在线.播放| 久久久亚洲精华液精华液精华液| 国产不卡在线播放| 狠狠狠色丁香婷婷综合激情 | 国产日韩v精品一区二区| 欧美精品一二三四| 日本丶国产丶欧美色综合| 视频在线观看一区二区三区| 亚洲欧美日韩在线播放| 亚洲三级在线免费| 中文字幕一区二区5566日韩| 国产精品久久久久久久久免费相片| 色哟哟一区二区| 色一情一乱一乱一91av| 色久综合一二码| 欧美系列在线观看| 欧美卡1卡2卡| 日韩欧美国产麻豆| 久久久久久夜精品精品免费| 国产亚洲视频系列| 中文一区二区完整视频在线观看| 欧美自拍偷拍午夜视频| 欧美午夜精品久久久| 欧美二区乱c少妇| 日韩精品中文字幕一区二区三区| 成人免费毛片app| 97久久人人超碰| 欧美在线不卡视频| 国产馆精品极品| 日韩成人精品视频| 韩国午夜理伦三级不卡影院| 国产经典欧美精品| 色婷婷国产精品| 6080国产精品一区二区| 欧美va在线播放| 国产亚洲精品久| 亚洲精品成人a在线观看| 亚洲成av人片一区二区梦乃| 日韩一区在线免费观看| 亚洲国产日日夜夜| 国产综合色视频| 97久久超碰精品国产| 欧美男同性恋视频网站| 久久久影视传媒| 一级精品视频在线观看宜春院 | 看国产成人h片视频| 国产精品一区二区无线| 99久久精品免费看| 国产成人综合亚洲网站| 91精品福利在线| 日韩免费观看高清完整版在线观看| 欧美日韩亚洲国产综合| 色婷婷av一区二区| 日韩三级精品电影久久久| 国产精品女同互慰在线看 | 麻豆精品一二三| 成人黄色电影在线| 欧美精品一二三| 国产精品乱码人人做人人爱| 日韩精品亚洲一区| 99视频一区二区| 精品久久国产97色综合| 洋洋成人永久网站入口| 亚洲影院免费观看| 成人一区二区在线观看| 成人精品电影在线观看| 日韩写真欧美这视频| 亚洲精品免费电影| 亚洲乱码中文字幕综合| 国产精品69毛片高清亚洲| 欧美日韩不卡在线| 一区二区在线观看免费| 国产精品66部| 北条麻妃一区二区三区| 精品国产区一区| 日本不卡视频在线| 另类的小说在线视频另类成人小视频在线| 日韩vs国产vs欧美| 欧美视频一区二区三区四区| 欧美日韩亚洲综合| 亚洲一级二级三级在线免费观看| 亚洲一区二区三区四区五区黄| 日韩成人伦理电影在线观看| 欧洲人成人精品| 自拍偷拍亚洲激情| youjizz久久| 国产午夜亚洲精品羞羞网站| 亚洲日本成人在线观看| 粉嫩av亚洲一区二区图片| 精品国产免费一区二区三区四区 | 国产精品一区二区三区四区| www.欧美日韩国产在线| 久久青草欧美一区二区三区| 另类小说欧美激情| 欧美精品一区二区高清在线观看|