亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
欧美精品一区男女天堂| 91福利精品视频| 日韩一区二区三区高清免费看看| 亚洲一卡二卡三卡四卡| 色婷婷狠狠综合| 亚洲一级二级三级| 欧美一级午夜免费电影| 毛片av一区二区三区| 国产日韩亚洲欧美综合| 99re热视频精品| 亚洲综合精品久久| 欧美一区二区免费视频| 精品在线观看免费| 国产精品美女www爽爽爽| 91亚洲精品乱码久久久久久蜜桃| 亚洲一区二区美女| 精品黑人一区二区三区久久| 韩国v欧美v日本v亚洲v| 综合亚洲深深色噜噜狠狠网站| 色狠狠色狠狠综合| 久久99精品久久久久久动态图 | 欧美va亚洲va国产综合| 国产一区二三区| 日韩美女精品在线| 日韩一区二区三区视频在线| 国产成人综合精品三级| 亚洲已满18点击进入久久| 日韩欧美中文字幕精品| 99久久精品国产精品久久| 日日夜夜精品免费视频| 国产欧美一区二区三区在线看蜜臀| 91免费视频网址| 精品一区二区久久久| 亚洲精品国产精华液| 欧美tk—视频vk| 欧洲一区在线电影| 国产成人免费视频精品含羞草妖精 | 亚洲嫩草精品久久| 精品国偷自产国产一区| 欧美天堂一区二区三区| 国产精品羞羞答答xxdd| 日本色综合中文字幕| 中文字幕一区二区三区不卡在线| 日韩一级免费观看| 91福利小视频| 成人午夜在线视频| 美女在线一区二区| 夜夜操天天操亚洲| 中文字幕欧美国产| 精品处破学生在线二十三| 欧美日韩你懂得| 91网站视频在线观看| 国产精品中文有码| 日韩激情av在线| 亚洲一区二区三区四区在线| 国产婷婷色一区二区三区四区 | 老司机精品视频线观看86 | 亚洲h在线观看| 中文字幕在线不卡一区| xfplay精品久久| 欧美一区二区三区视频免费| 精品视频在线免费看| 99国产欧美另类久久久精品| 国产一区二区精品久久| 麻豆成人91精品二区三区| 亚洲福利视频三区| 一区二区三区精品在线| 亚洲色欲色欲www| 一区二区中文字幕在线| 亚洲国产岛国毛片在线| 国产日本欧美一区二区| 欧美成人video| 欧美成人在线直播| 日韩欧美一区中文| 日韩欧美色综合网站| 日韩欧美不卡在线观看视频| 欧美剧情片在线观看| 9191久久久久久久久久久| 欧美手机在线视频| 欧美日韩精品一区二区天天拍小说 | 欧美日韩国产免费| 欧美人妇做爰xxxⅹ性高电影| 欧美视频中文字幕| 欧美日韩一区二区电影| 精品1区2区3区| 欧美一区二区视频免费观看| 日韩视频免费观看高清完整版 | 在线电影欧美成精品| 欧美一区二区三区在线观看| 欧美一级精品在线| 2023国产精品视频| 国产欧美精品在线观看| 亚洲欧美偷拍另类a∨色屁股| 亚洲精品亚洲人成人网 | 亚洲色欲色欲www| 亚洲午夜成aⅴ人片| 日本不卡免费在线视频| 国内精品嫩模私拍在线| a4yy欧美一区二区三区| 欧美日产国产精品| 精品国产一区二区三区忘忧草| 久久久久久9999| 亚洲黄色av一区| 日本免费新一区视频| 国产成人精品亚洲日本在线桃色| 99re6这里只有精品视频在线观看| 欧美日韩精品是欧美日韩精品| 欧美成人一区二区三区| **欧美大码日韩| 蜜臀久久99精品久久久久久9| 成人午夜精品一区二区三区| 欧美亚洲动漫另类| 精品国产一区二区三区av性色| 中文字幕欧美日韩一区| 亚洲电影你懂得| 国产xxx精品视频大全| 91久久精品午夜一区二区| 日韩一区和二区| 中文字幕一区不卡| 日本午夜一本久久久综合| 国产91精品在线观看| 欧美视频在线一区二区三区 | 精品亚洲成a人| 色综合一区二区| 精品久久久久久久一区二区蜜臀| 亚洲三级电影网站| 精一区二区三区| 欧美视频一区二区| 国产欧美日韩久久| 日韩电影在线一区二区| 99国产欧美另类久久久精品 | 4438成人网| 亚洲欧美中日韩| 亚洲伦理在线精品| 日本在线不卡一区| 91视频xxxx| 久久众筹精品私拍模特| 亚洲一区二区三区在线| 国产剧情一区二区三区| 欧美日韩成人在线一区| 国产精品久久久久7777按摩| 日韩成人一级大片| 99精品国产一区二区三区不卡| 欧美精品一区二区三区四区 | 欧美mv日韩mv国产网站app| 亚洲一二三四区不卡| 91丨九色丨蝌蚪丨老版| 国产婷婷色一区二区三区| 青青草一区二区三区| 欧美亚洲综合一区| 亚洲色欲色欲www| 成人动漫在线一区| 久久精品一区八戒影视| 激情欧美一区二区| 精品免费日韩av| 另类专区欧美蜜桃臀第一页| 欧美日韩国产一级二级| 亚洲免费高清视频在线| 91免费在线视频观看| 自拍av一区二区三区| 成人app软件下载大全免费| 国产亚洲精品精华液| 国产永久精品大片wwwapp| 日韩欧美视频在线| 久久爱www久久做| 日韩欧美一区二区在线视频| 天堂在线亚洲视频| 91精品国产综合久久久久久 | 亚洲免费看黄网站| 91在线国产福利| 亚洲精品videosex极品| 91黄色小视频| 亚洲午夜电影在线| 欧美精品日韩一本| 青青草一区二区三区| 欧美成人a在线| 国产乱码精品一区二区三| 国产亚洲综合在线| 成人精品视频一区| 亚洲乱码国产乱码精品精小说| 日本伊人精品一区二区三区观看方式| 欧美一区二区三区在线电影| 九九热在线视频观看这里只有精品| 精品免费视频.| 成人免费毛片app| 亚洲欧美aⅴ...| 制服丝袜成人动漫| 美女视频免费一区| 久久精品水蜜桃av综合天堂| av综合在线播放| 亚洲高清免费观看高清完整版在线观看 | 欧美丰满美乳xxx高潮www| 日本亚洲最大的色成网站www| 精品国产伦一区二区三区免费| 国产1区2区3区精品美女| 亚洲色图19p| 欧美一卡2卡3卡4卡| 成人免费的视频| 亚洲在线成人精品| 日韩欧美在线不卡|