Exemple #1
0
 /**
  * If the index is still required by a constraint, transfer the ownership to it. Otherwise, the
  * index is removed.
  *
  * @param session the session
  * @param index the index that is no longer required
  */
 public void removeIndexOrTransferOwnership(Session session, Index index) {
   boolean stillNeeded = false;
   if (constraints != null) {
     for (Constraint cons : constraints) {
       if (cons.usesIndex(index)) {
         cons.setIndexOwner(index);
         database.update(session, cons);
         stillNeeded = true;
       }
     }
   }
   if (!stillNeeded) {
     database.removeSchemaObject(session, index);
   }
 }