Пример #1
0
 /**
  * @param schemaTable
  * @param tableDef
  * @throws SqlJetException
  */
 private void dropTableIndexes(SqlJetTableDef tableDef) throws SqlJetException {
   final String tableName = tableDef.getName();
   final Iterator<Map.Entry<String, ISqlJetIndexDef>> iterator = indexDefs.entrySet().iterator();
   while (iterator.hasNext()) {
     final Map.Entry<String, ISqlJetIndexDef> indexDefEntry = iterator.next();
     final String indexName = indexDefEntry.getKey();
     final ISqlJetIndexDef indexDef = indexDefEntry.getValue();
     if (indexDef.getTableName().equals(tableName)) {
       if (doDropIndex(indexName, true, false)) {
         iterator.remove();
       }
     }
   }
 }
Пример #2
0
 public Set<ISqlJetIndexDef> getIndexes(String tableName) throws SqlJetException {
   db.getMutex().enter();
   try {
     Set<ISqlJetIndexDef> result = new HashSet<ISqlJetIndexDef>();
     for (ISqlJetIndexDef index : indexDefs.values()) {
       if (index.getTableName().equals(tableName)) {
         result.add(index);
       }
     }
     return Collections.unmodifiableSet(result);
   } finally {
     db.getMutex().leave();
   }
 }