public boolean setDistinctColumnsOnIndex(int[] colMap) {

    if (joinConditions.length != 1) {
      return false;
    }

    int[] indexColMap = joinConditions[0].rangeIndex.getColumns();

    if (colMap.length > indexColMap.length) {
      return false;
    }

    if (colMap.length == indexColMap.length) {
      if (ArrayUtil.haveEqualSets(colMap, indexColMap, colMap.length)) {
        indexDistinctCount = colMap.length;

        return true;
      }
    }

    if (ArrayUtil.haveEqualArrays(colMap, indexColMap, colMap.length)) {
      indexDistinctCount = colMap.length;

      return true;
    }

    return false;
  }
Exemplo n.º 2
0
  /** Compares this with another constraint column set. This is used only for UNIQUE constraints. */
  boolean isUniqueWithColumns(int[] cols) {

    if (constType != UNIQUE || core.mainCols.length != cols.length) {
      return false;
    }

    return ArrayUtil.haveEqualSets(core.mainCols, cols, cols.length);
  }
Exemplo n.º 3
0
 boolean isUniqueWithColumns(int[] paramArrayOfInt) {
   switch (this.constType) {
     case 2:
     case 4:
       if (this.core.mainCols.length == paramArrayOfInt.length)
         return ArrayUtil.haveEqualSets(
             this.core.mainCols, paramArrayOfInt, paramArrayOfInt.length);
       break;
   }
   return false;
 }