示例#1
0
 private Column undeclaredHKeyColumn(HKeyColumn hKeyColumn) {
   Column undeclaredHKeyColumn = null;
   int rootMostDepth = rootMostTable().getDepth();
   List<Column> equivalentColumns = hKeyColumn.equivalentColumns();
   switch (getJoinType()) {
     case LEFT:
       // use a rootward bias, but no more rootward than the rootmost table
       for (Column equivalentColumn : equivalentColumns) {
         int equivalentColumnDepth = equivalentColumn.getTable().getDepth();
         if (undeclaredHKeyColumn == null && equivalentColumnDepth >= rootMostDepth) {
           undeclaredHKeyColumn = equivalentColumn;
         }
       }
       break;
     case RIGHT:
       // use a leafward bias, but no more leafward than the leafdmost table
       int leafMostDepth = leafMostTable().getDepth();
       for (ListIterator<Column> reverseCols =
               equivalentColumns.listIterator(equivalentColumns.size());
           reverseCols.hasPrevious(); ) {
         Column equivalentColumn = reverseCols.previous();
         int equivalentColumnDepth = equivalentColumn.getTable().getDepth();
         if (undeclaredHKeyColumn == null && equivalentColumnDepth <= leafMostDepth) {
           undeclaredHKeyColumn = equivalentColumn;
         }
       }
       break;
   }
   if (undeclaredHKeyColumn == null) {
     undeclaredHKeyColumn = hKeyColumn.column();
   }
   return undeclaredHKeyColumn;
 }
示例#2
0
 private static int columnPosition(
     Map<? extends Table, Integer> flattenedRowOffsets, Column column) {
   int position = column.getPosition();
   Integer offset = flattenedRowOffsets.get(column.getTable());
   if (offset == null) {
     throw new NullPointerException(
         "no offset for " + column.getTable() + " in " + flattenedRowOffsets);
   }
   position += offset;
   return position;
 }
示例#3
0
 public void markInvolvedInIndex(Column column) {
   assert column.getTable() == table;
   inIndex.set(column.getPosition(), true);
 }
示例#4
0
 private int depth(Column column) {
   return column.getTable().getDepth();
 }