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


Java TableIndexDao类代码示例

本文整理汇总了Java中mil.nga.geopackage.extension.index.TableIndexDao的典型用法代码示例。如果您正苦于以下问题:Java TableIndexDao类的具体用法?Java TableIndexDao怎么用?Java TableIndexDao使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TableIndexDao类属于mil.nga.geopackage.extension.index包,在下文中一共展示了TableIndexDao类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: deleteGeometryIndex

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * Delete the Geometry Index extension for the table
 * 
 * @param geoPackage
 * @param table
 * @since 1.1.5
 */
public static void deleteGeometryIndex(GeoPackageCore geoPackage,
		String table) {

	TableIndexDao tableIndexDao = geoPackage.getTableIndexDao();
	ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();

	try {
		if (tableIndexDao.isTableExists()) {
			tableIndexDao.deleteByIdCascade(table);
		}
		if (extensionsDao.isTableExists()) {
			extensionsDao.deleteByExtension(
					FeatureTableCoreIndex.EXTENSION_NAME, table);
		}
	} catch (SQLException e) {
		throw new GeoPackageException(
				"Failed to delete Table Index. GeoPackage: "
						+ geoPackage.getName() + ", Table: " + table, e);
	}
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:28,代码来源:NGAExtensions.java

示例2: createTableIndexTable

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public boolean createTableIndexTable() {
	verifyWritable();

	boolean created = false;
	TableIndexDao dao = getTableIndexDao();
	try {
		if (!dao.isTableExists()) {
			created = tableCreator.createTableIndex() > 0;
		}
	} catch (SQLException e) {
		throw new GeoPackageException("Failed to check if "
				+ TableIndex.class.getSimpleName()
				+ " table exists and create it", e);
	}
	return created;
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:21,代码来源:GeoPackageCoreImpl.java

示例3: deleteGeometryIndexExtension

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * Delete the Geometry Index extension including the extension entries and
 * custom tables
 * 
 * @param geoPackage
 * @param ignoreErrors
 * @since 1.1.5
 */
public static void deleteGeometryIndexExtension(GeoPackageCore geoPackage,
		boolean ignoreErrors) {

	GeometryIndexDao geometryIndexDao = geoPackage.getGeometryIndexDao();
	TableIndexDao tableIndexDao = geoPackage.getTableIndexDao();
	ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();
	ConnectionSource connectionSource = geoPackage.getDatabase()
			.getConnectionSource();

	try {
		if (geometryIndexDao.isTableExists()) {
			TableUtils.dropTable(connectionSource, GeometryIndex.class,
					ignoreErrors);
		}
		if (tableIndexDao.isTableExists()) {
			TableUtils.dropTable(connectionSource, TableIndex.class,
					ignoreErrors);
		}
		if (extensionsDao.isTableExists()) {
			extensionsDao.deleteByExtension(
					FeatureTableCoreIndex.EXTENSION_NAME);
		}
	} catch (SQLException e) {
		throw new GeoPackageException(
				"Failed to delete Table Index extension and tables. GeoPackage: "
						+ geoPackage.getName(), e);
	}

}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:38,代码来源:NGAExtensions.java

示例4: testDeleteAll

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * Test table index delete all
 *
 * @param geoPackage
 * @throws SQLException
 */
public static void testDeleteAll(GeoPackage geoPackage) throws SQLException {

    // Test indexing each feature table
    List<String> featureTables = geoPackage.getFeatureTables();
    for (String featureTable : featureTables) {

        FeatureDao featureDao = geoPackage.getFeatureDao(featureTable);
        FeatureTableIndex featureTableIndex = new FeatureTableIndex(
                geoPackage, featureDao);

        TestCase.assertFalse(featureTableIndex.isIndexed());

        TestUtils.validateGeoPackage(geoPackage);

        // Test indexing
        featureTableIndex.index();
        TestUtils.validateGeoPackage(geoPackage);

        TestCase.assertTrue(featureTableIndex.isIndexed());

    }

    ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();
    GeometryIndexDao geometryIndexDao = geoPackage.getGeometryIndexDao();
    TableIndexDao tableIndexDao = geoPackage.getTableIndexDao();

    TestCase.assertTrue(geometryIndexDao.isTableExists());
    TestCase.assertTrue(tableIndexDao.isTableExists());
    TestCase.assertTrue(extensionsDao.queryByExtension(
            FeatureTableIndex.EXTENSION_NAME).size() > 0);

    TestCase.assertTrue(geometryIndexDao.countOf() > 0);
    long count = tableIndexDao.countOf();
    TestCase.assertTrue(count > 0);

    int deleteCount = tableIndexDao.deleteAllCascade();
    TestCase.assertEquals(count, deleteCount);

    TestCase.assertTrue(geometryIndexDao.countOf() == 0);
    TestCase.assertTrue(tableIndexDao.countOf() == 0);
}
 
开发者ID:ngageoint,项目名称:geopackage-android,代码行数:48,代码来源:FeatureTableIndexUtils.java

示例5: getTableIndexDao

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public TableIndexDao getTableIndexDao() {
	return createDao(TableIndex.class);
}
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:8,代码来源:GeoPackageCoreImpl.java

示例6: testDeleteAll

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * Test table index delete all
 * 
 * @param geoPackage
 * @throws SQLException
 */
public static void testDeleteAll(GeoPackage geoPackage) throws SQLException {

	// Test indexing each feature table
	List<String> featureTables = geoPackage.getFeatureTables();
	for (String featureTable : featureTables) {

		FeatureDao featureDao = geoPackage.getFeatureDao(featureTable);
		FeatureTableIndex featureTableIndex = new FeatureTableIndex(
				geoPackage, featureDao);

		TestCase.assertFalse(featureTableIndex.isIndexed());

		TestUtils.validateGeoPackage(geoPackage);

		// Test indexing
		featureTableIndex.index();
		TestUtils.validateGeoPackage(geoPackage);

		TestCase.assertTrue(featureTableIndex.isIndexed());

	}

	ExtensionsDao extensionsDao = geoPackage.getExtensionsDao();
	GeometryIndexDao geometryIndexDao = geoPackage.getGeometryIndexDao();
	TableIndexDao tableIndexDao = geoPackage.getTableIndexDao();

	TestCase.assertTrue(geometryIndexDao.isTableExists());
	TestCase.assertTrue(tableIndexDao.isTableExists());
	TestCase.assertTrue(extensionsDao.queryByExtension(
			FeatureTableIndex.EXTENSION_NAME).size() > 0);

	TestCase.assertTrue(geometryIndexDao.countOf() > 0);
	long count = tableIndexDao.countOf();
	TestCase.assertTrue(count > 0);

	int deleteCount = tableIndexDao.deleteAllCascade();
	TestCase.assertEquals(count, deleteCount);

	TestCase.assertTrue(geometryIndexDao.countOf() == 0);
	TestCase.assertTrue(tableIndexDao.countOf() == 0);
}
 
开发者ID:ngageoint,项目名称:geopackage-java,代码行数:48,代码来源:FeatureTableIndexUtils.java

示例7: getTableIndexDao

import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
 * Get a Table Index DAO
 * 
 * @return table index dao
 * @since 1.1.0
 */
public TableIndexDao getTableIndexDao();
 
开发者ID:ngageoint,项目名称:geopackage-core-java,代码行数:8,代码来源:GeoPackageCore.java


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