Ejemplo n.º 1
0
 public static String findExistingColumn(PTable table, List<PColumn> columns) {
   for (PColumn column : columns) {
     PName familyName = column.getFamilyName();
     if (familyName == null) {
       try {
         return table.getPKColumn(column.getName().getString()).getName().getString();
       } catch (ColumnNotFoundException e) {
         continue;
       }
     } else {
       try {
         return table
             .getColumnFamily(familyName.getString())
             .getColumn(column.getName().getString())
             .getName()
             .getString();
       } catch (ColumnFamilyNotFoundException e) {
         continue; // Shouldn't happen
       } catch (ColumnNotFoundException e) {
         continue;
       }
     }
   }
   return null;
 }