本文整理汇总了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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例5: getTableIndexDao
import mil.nga.geopackage.extension.index.TableIndexDao; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public TableIndexDao getTableIndexDao() {
return createDao(TableIndex.class);
}
示例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);
}
示例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();