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

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

?? tablesdependencyhelper.java

?? 采用 Java 編寫的數據庫系統單元測試程序。
?? JAVA
字號:
/*
 *
 * The DbUnit Database Testing Framework
 * Copyright (C)2005, DbUnit.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
package org.dbunit.database.search;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import org.dbunit.database.IDatabaseConnection;
import org.dbunit.dataset.FilteredDataSet;
import org.dbunit.dataset.IDataSet;
import org.dbunit.dataset.filter.ITableFilter;

import org.dbunit.util.CollectionsHelper;
import org.dbunit.util.search.DepthFirstSearch;
import org.dbunit.util.search.SearchException;


/**
 * Helper for the graph-search based classes used to calculate dependency
 * among tables.  
 * 
 * @author Felipe Leme <dbunit@felipeal.net>
 * @version $Revision: 554 $
 * @since Aug 26, 2005
 */
public class TablesDependencyHelper {

    /**
     * Logger for this class
     */
    private static final Logger logger = LoggerFactory.getLogger(TablesDependencyHelper.class);
  
  // this is a "static" class
  private TablesDependencyHelper() {
  }
  
  /**
   * Get the name of all tables that depend on a root table (i.e, all tables whose PK
   * is a FK for the root table).
   * @param connection database conncetion
   * @param rootTable root table described above
   * @return name of all tables that depend on the root table (including the root table), 
   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getDependentTables( IDatabaseConnection connection, String rootTable ) throws SearchException {
        logger.debug("getDependentTables(connection=" + connection + ", rootTable=" + rootTable + ") - start");

    return getDependentTables( connection, new String[] { rootTable } );    
  }
  
  /**
   * Get the name of all tables that depend on the root tables (i.e, all tables whose PK
   * is a FK for one of root tables).
   * @param connection database conncetion
   * @param rootTables array of root tables described above
   * @return name of all tables that depend on the root tables (including the root tables), 
   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getDependentTables( IDatabaseConnection connection, String[] rootTables ) throws SearchException {
        logger.debug("getDependentTables(connection=" + connection + ", rootTables=" + rootTables + ") - start");

    ImportedKeysSearchCallback callback = new ImportedKeysSearchCallback(connection);
    DepthFirstSearch search = new DepthFirstSearch();
    Set tables = search.search( rootTables, callback );
    return (String[]) CollectionsHelper.setToStrings( tables );
  }
  
  /**
   * Get the name of all tables that depend on a root table ( i.e, all tables whose PK
   * is a FK for the root table) and also the tables the root table depends on 
   * (i.e., all tables which have a FK for the root table's PK). 
   * @param connection database conncetion
   * @param rootTable root table described above
   * @return name of all tables that depend on the root table (including the root table), 
   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getAllDependentTables( IDatabaseConnection connection, String rootTable ) throws SearchException {
        logger.debug("getAllDependentTables(connection=" + connection + ", rootTable=" + rootTable + ") - start");

    return getAllDependentTables( connection, new String[] { rootTable } );    
  }
  
  /**
   * Get the name of all tables that depend on the root tables ( i.e, all tables whose PK
   * is a FK for any of the root tables) and also the tables the root tables depends on 
   * (i.e., all tables which have a FK for any of the root table's PK). 
   * @param connection database conncetion
   * @param rootTables root tables described above
   * @return name of all tables that depend on the root tables (including the root tables), 
   * in the right order for insertions
   * @throws SearchException if an exception occurred while calculating the order
   */
  public static String[] getAllDependentTables( IDatabaseConnection connection, String[] rootTables ) throws SearchException {
        logger.debug("getAllDependentTables(connection=" + connection + ", rootTables=" + rootTables + ") - start");

    ImportedAndExportedKeysSearchCallback callback = new ImportedAndExportedKeysSearchCallback(connection);
    DepthFirstSearch search = new DepthFirstSearch();
    Set tables = search.search( rootTables, callback );
    return (String[]) CollectionsHelper.setToStrings( tables );
  }

  // TODO: javadoc (and unit tests) from down here...

  public static IDataSet getDataset( IDatabaseConnection connection, String rootTable, Set allowedIds ) throws SearchException, SQLException {
        logger.debug("getDataset(connection=" + connection + ", rootTable=" + rootTable + ", allowedIds=" + allowedIds
                + ") - start");

    HashMap map = new HashMap(1);
    map.put( rootTable, allowedIds );
    return getDataset( connection, map );
  }
  
  public static IDataSet getDataset( IDatabaseConnection connection, Map rootTables ) throws SearchException, SQLException {
        logger.debug("getDataset(connection=" + connection + ", rootTables=" + rootTables + ") - start");

    ImportedKeysSearchCallbackFilteredByPKs callback = new ImportedKeysSearchCallbackFilteredByPKs(connection, rootTables);
    ITableFilter filter = callback.getFilter();
    DepthFirstSearch search = new DepthFirstSearch();
    String[] tableNames = CollectionsHelper.setToStrings( rootTables.keySet() ); 
    Set tmpTables = search.search( tableNames, callback );
    String[] dependentTables  = CollectionsHelper.setToStrings( tmpTables );
    IDataSet tmpDataset = connection.createDataSet( dependentTables );
    FilteredDataSet dataset = new FilteredDataSet(filter, tmpDataset);
    return dataset;
  }

  public static IDataSet getAllDataset( IDatabaseConnection connection, String rootTable, Set allowedPKs ) throws SearchException, SQLException {
        logger.debug("getAllDataset(connection=" + connection + ", rootTable=" + rootTable + ", allowedPKs="
                + allowedPKs + ") - start");

    HashMap map = new HashMap(1);
    map.put( rootTable, allowedPKs );
    return getAllDataset( connection, map );
  }
  
  public static IDataSet getAllDataset( IDatabaseConnection connection, Map rootTables ) throws SearchException, SQLException {
        logger.debug("getAllDataset(connection=" + connection + ", rootTables=" + rootTables + ") - start");

    ImportedAndExportedKeysSearchCallbackFilteredByPKs callback = new ImportedAndExportedKeysSearchCallbackFilteredByPKs(connection, rootTables);    
    ITableFilter filter = callback.getFilter();
    DepthFirstSearch search = new DepthFirstSearch();
    String[] tableNames = CollectionsHelper.setToStrings( rootTables.keySet() ); 
    Set tmpTables = search.search( tableNames, callback );
    String[] dependentTables  = CollectionsHelper.setToStrings( tmpTables );
    IDataSet tmpDataset = connection.createDataSet( dependentTables );
    FilteredDataSet dataset = new FilteredDataSet(filter, tmpDataset);
    return dataset;
  }
  
  
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区美女| 久久精品视频在线看| 欧美一区二区三区在线看| 亚洲精品在线一区二区| 国产精品丝袜一区| 亚洲一区二区影院| 麻豆精品视频在线观看| 国产电影一区在线| 欧美亚洲高清一区| 精品国产乱码久久久久久闺蜜| 欧美高清一级片在线观看| 一区二区在线电影| 精品一区二区三区香蕉蜜桃| 成人av片在线观看| 欧美精品一二三区| 国产精品高潮呻吟| 爽好久久久欧美精品| 国产精品1区2区| 欧美午夜视频网站| 久久久精品欧美丰满| 一级日本不卡的影视| 国产原创一区二区| 欧美日韩一二三| 欧美高清在线一区二区| 天堂资源在线中文精品| 99久久综合精品| 日韩三级电影网址| 亚洲免费av观看| 国产一区二区三区四区五区美女 | 精品乱人伦一区二区三区| 亚洲欧洲日韩一区二区三区| 免费观看久久久4p| 在线这里只有精品| 国产精品私人影院| 久久aⅴ国产欧美74aaa| 在线视频你懂得一区| 国产香蕉久久精品综合网| 偷拍自拍另类欧美| 99精品黄色片免费大全| 久久精品网站免费观看| 日韩不卡一区二区| 一本久久a久久免费精品不卡| 国产视频在线观看一区二区三区| 日韩二区三区四区| 欧日韩精品视频| 国产精品国产三级国产普通话三级 | 国产精品资源在线观看| 51精品国自产在线| 亚洲一区二区三区精品在线| jlzzjlzz国产精品久久| 久久亚洲欧美国产精品乐播| 青青青伊人色综合久久| 欧美色电影在线| 亚洲免费在线看| 色狠狠av一区二区三区| 国产精品久久久久三级| 国模无码大尺度一区二区三区| 欧美剧情电影在线观看完整版免费励志电影 | 亚洲一区二区三区四区在线| 99国产精品99久久久久久| 国产欧美va欧美不卡在线| 精品一区二区三区香蕉蜜桃| 欧美一区二区人人喊爽| 午夜精彩视频在线观看不卡| 在线视频国内一区二区| 亚洲乱码中文字幕| 99riav一区二区三区| 中文字幕亚洲电影| 成人av资源网站| 国产女同性恋一区二区| 国产美女在线精品| 国产午夜精品久久久久久免费视| 国产一区二区91| 久久久久久久久久看片| 国产一区二区三区国产| 国产欧美一区二区精品秋霞影院 | 久久综合网色—综合色88| 国产在线一区二区| 久久久久亚洲蜜桃| 成人精品视频一区二区三区 | 成人成人成人在线视频| 国产精品免费丝袜| 97se亚洲国产综合在线| 一区二区三区中文字幕精品精品| 95精品视频在线| 亚洲午夜久久久久久久久久久 | 日本亚洲电影天堂| 欧美videos中文字幕| 国产剧情一区在线| 日本一区二区视频在线| 99re热视频这里只精品| 亚洲欧美激情一区二区| 在线观看日韩电影| 日韩精品国产精品| 2024国产精品视频| 成人综合在线网站| 中文字幕中文字幕在线一区 | 日韩黄色在线观看| 精品国产一二三区| 成人av集中营| 一区二区三区日韩欧美| 欧美肥妇bbw| 激情欧美一区二区| 国产精品天美传媒沈樵| 欧美视频完全免费看| 日韩高清在线一区| 久久免费视频一区| 色哟哟亚洲精品| 日韩av电影一区| 中文字幕+乱码+中文字幕一区| 一本久久a久久精品亚洲| 亚洲成人av电影在线| 欧美一级黄色片| 成人性生交大合| 亚洲一区二区在线视频| 久久综合色一综合色88| 99精品视频一区二区| 亚洲成人av资源| 国产欧美一区二区三区网站| 91欧美一区二区| 麻豆精品视频在线观看| 亚洲视频网在线直播| 欧美精品久久99| 成人中文字幕在线| 首页国产欧美久久| 欧美韩国一区二区| 欧美肥妇free| www.性欧美| 蜜臀av性久久久久蜜臀aⅴ流畅 | 成人黄页在线观看| 国产福利不卡视频| 水野朝阳av一区二区三区| 国产精品免费aⅴ片在线观看| 欧美日韩精品专区| 懂色av噜噜一区二区三区av| 亚洲444eee在线观看| 中文字幕免费在线观看视频一区| 日本电影欧美片| 久久99精品久久久久久动态图| 亚洲免费在线观看| 国产婷婷一区二区| 日韩午夜小视频| 欧美中文字幕一区二区三区 | 精品久久久久久久久久久久久久久| 99国产精品久久久久久久久久久| 免费看日韩精品| 亚洲视频一区二区在线| 国产亚洲精久久久久久| 欧美一区二区私人影院日本| 91麻豆免费在线观看| 国产精品88888| 久久成人免费网站| 日韩国产一区二| 一区二区免费视频| 国产精品久久久久久久久免费桃花| 精品久久久影院| 777色狠狠一区二区三区| 一本一本久久a久久精品综合麻豆| 国产成人在线电影| 九色综合狠狠综合久久| 水野朝阳av一区二区三区| 亚洲精品免费在线| 综合色天天鬼久久鬼色| 国产欧美一区二区精品仙草咪| 精品久久久久久久一区二区蜜臀| 精品视频在线免费| 欧美性猛片aaaaaaa做受| 97久久精品人人做人人爽50路| 国产在线精品国自产拍免费| 美女在线一区二区| 日韩和欧美一区二区| 亚洲成a人片综合在线| 亚洲一区二区欧美| 亚洲精品视频一区二区| 国产精品传媒视频| 亚洲人成亚洲人成在线观看图片| 欧美国产激情二区三区| 国产精品欧美久久久久一区二区| 国产日韩欧美在线一区| 久久一二三国产| 久久久久久一二三区| 亚洲精品在线免费观看视频| 日韩免费性生活视频播放| 欧美一区二区三区啪啪| 日韩欧美国产午夜精品| 精品乱码亚洲一区二区不卡| 精品精品国产高清一毛片一天堂| 日韩免费看的电影| 精品国产三级a在线观看| 精品欧美久久久| 国产日韩欧美a| 国产精品久久三| 日韩理论片在线| 亚洲一区二区在线播放相泽| 亚洲.国产.中文慕字在线| 亚洲成av人片一区二区| 日韩精品亚洲一区| 久99久精品视频免费观看| 国产成人在线色| 91麻豆.com|