当前位置: 首页>>代码示例>>Java>>正文


Java Table.getIndexes方法代码示例

本文整理汇总了Java中com.healthmarketscience.jackcess.Table.getIndexes方法的典型用法代码示例。如果您正苦于以下问题:Java Table.getIndexes方法的具体用法?Java Table.getIndexes怎么用?Java Table.getIndexes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.healthmarketscience.jackcess.Table的用法示例。


在下文中一共展示了Table.getIndexes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTables

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
/**
 * Iterate over the MDB database and create SQLite tables for every table
 * defined in the MS Access database.
 * 
 * @param jdbc The SQLite database JDBC connection
 */
@SuppressWarnings("unchecked")
private static void createTables(Database mdb, SqlJetDb sqlite) throws Exception {
	for (String tableName : mdb.getTableNames()) {
		Table table = mdb.getTable(tableName);
		sqlite.beginTransaction(SqlJetTransactionMode.WRITE);
		try {
			sqlite.createTable(MDB2SQLite.createTableStatement(table));
			for (Index index : (List<Index>) table.getIndexes()) {
				sqlite.createIndex(MDB2SQLite.createIndexStatement(index));
			}
		} finally {
			sqlite.commit();
		}
	}
}
 
开发者ID:mbrigl,项目名称:mdb2sqlite,代码行数:22,代码来源:MDB2SQLite.java

示例2: loadTableFKs

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
private void loadTableFKs(String tableName) throws IOException,
		SQLException {
	Table table = dbIO.getTable(tableName);
	for (Index idxi : table.getIndexes()) {
		//riw
		IndexImpl idx=(IndexImpl)idxi;
		if (idx.isForeignKey() && !idx.getReference().isPrimaryTable())
			loadForeignKey(idx);
		}
}
 
开发者ID:andrew-nguyen,项目名称:ucanaccess,代码行数:11,代码来源:LoadJet.java

示例3: loadTableIndexes

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
private void loadTableIndexes(String tableName) throws IOException,
		SQLException {
	Table table = dbIO.getTable(tableName);
	for (Index idx : table.getIndexes()) {
		if (!idx.isForeignKey())
			loadIndex(idx);
	}
}
 
开发者ID:andrew-nguyen,项目名称:ucanaccess,代码行数:9,代码来源:LoadJet.java

示例4: debugTable

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
private static void debugTable(Table table, SequenceWriter columnCsv) throws IOException {

		System.out.println("\tTable columns for " + table.getName());

		try {
			for (Column nextColumn : table.getColumns()) {
				System.out.println("\t\t" + nextColumn.getName());
				columnCsv.write(Arrays.asList(table.getName() + "." + nextColumn.getName(),
						table.getName() + "." + nextColumn.getName(), "", ""));
			}

			Index primaryKeyIndex = table.getPrimaryKeyIndex();
			System.out.println(
					"\tFound primary key index for table: " + table.getName() + " named " + primaryKeyIndex.getName());
			debugIndex(primaryKeyIndex, new HashSet<>(), columnCsv);

			for (Index nextIndex : table.getIndexes()) {
				if (!nextIndex.getName().equals(primaryKeyIndex.getName())) {
					System.out.println("\tFound non-primary key index for table: " + table.getName() + " named "
							+ nextIndex.getName());
					debugIndex(nextIndex, new HashSet<>(), null);
				}
			}
		} catch (IllegalArgumentException e) {
			System.out.println("No primary key index found for table: " + table.getName());
		}

		Cursor cursor = table.getDefaultCursor();
		int i = 0;
		while (cursor.moveToNextRow()) {
			if (i >= 5) {
				break;
			}
			System.out.println(cursor.getCurrentRow().toString());
			i++;
		}
	}
 
开发者ID:ansell,项目名称:csvsum,代码行数:38,代码来源:AccessMapper.java

示例5: getPrimaryKeys

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
/**
 * Get all primary keys for the table
 * 
 * @param table
 * @return a list of primary keys
 */
private List<String> getPrimaryKeys(Table table) {
	log.debug("getPrimaryKeys");
	List<String> primaryKeyList = new ArrayList<String>();

	for (Index index : table.getIndexes()) {
		for (Index.Column column : index.getColumns()) {
			if (index.isPrimaryKey()) {
				primaryKeyList.add(column.getName());
			}
		}
	}
	return primaryKeyList;
}
 
开发者ID:ox-it,项目名称:ords-database-api,代码行数:20,代码来源:PostgresAccessDatabaseServiceImpl.java

示例6: testIndexCodes

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
public void testIndexCodes() throws Exception
{
  for (final TestDB testDB : TestDB.getSupportedForBasename(Basename.INDEX_CODES)) {
    Database db = openMem(testDB);

    for(Table t : db) {
      for(Index index : t.getIndexes()) {
//         System.out.println("Checking " + t.getName() + "." + index.getName());
        checkIndexEntries(testDB, t, index);
      }
    }

    db.close();
  }
}
 
开发者ID:jahlborn,项目名称:jackcess,代码行数:16,代码来源:IndexCodesTest.java

示例7: getPrimaryKeyColumns

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
/**
 * Searches for a primary key index on the given table and returns the columns that were used for the index key.
 * If the table does not have a primary key index the returned list will be empty.
 *
 * @param table the table on which to search for a primary key index
 * @return the list of columns used for the index key or an empty list, if no primary key index exists
 */
private List<? extends Index.Column> getPrimaryKeyColumns(Table table) {
    for (Index index : table.getIndexes()) {
        if (index.isPrimaryKey()) {
            return index.getColumns();
        }
    }

    return Collections.emptyList();
}
 
开发者ID:hzpz,项目名称:access-export,代码行数:17,代码来源:SQLiteSQLGenerator.java

示例8: createIndexes

import com.healthmarketscience.jackcess.Table; //导入方法依赖的package包/类
/**
 * Iterate over and create SQLite indeces for every index defined
 * in the MS Access table.
 * 
 * @param table MS Access table
 * @param jdbc The SQLite database JDBC connection
 * @throws SQLException
 */
private void createIndexes(final Table table, final Connection jdbc) throws SQLException {
    final List<Index> indexes = table.getIndexes();

    for (Index index : indexes) {
        createIndex(index, jdbc);
    }
}
 
开发者ID:tinogomes,项目名称:mdb-sqlite,代码行数:16,代码来源:AccessExporter.java


注:本文中的com.healthmarketscience.jackcess.Table.getIndexes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。