private static Column findColumn(PrimaryKeyColumn pkc) { requireNonNull(pkc); return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
private Column findColumn(PrimaryKeyColumn pkc) { return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
private Column findColumn(PrimaryKeyColumn pkc) { return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
@Override public Optional<ImmutableColumn> findColumn() { return column.getOrCompute(() -> PrimaryKeyColumn.super.findColumn() .map(ImmutableColumn.class::cast) ); }
/** * Returns the full name used in the database for the specified * {@link PrimaryKeyColumn}. This is typically constructed by combining the * table and the column name with a separator, but that might be different * in different implementations. * * @param pkc the primary key column to retrieve the name of * @return the full name */ default String fullNameOf(PrimaryKeyColumn pkc) { return fullNameOf(pkc.findColumn().orElseThrow(() -> new SpeedmentException("Cannot find column for " + pkc))); }
private Stream<Column> columnsFromPks() { return primaryKeyColumns().map(pk -> { try { return pk.findColumn().get(); } catch (final NoSuchElementException ex) { throw new SpeedmentTranslatorException( "Could not find any column belonging to primary key '" + pk.getId() + "'.", ex ); } }); } }
.noneMatch(col -> table.primaryKeyColumns().anyMatch(pkc -> DocumentDbUtil.isSame(pkc.findColumn().get(), col))) && table.columns().map(Column::getId).noneMatch("rowid"::equalsIgnoreCase)) { final Column column = table.mutator().addNewColumn(); table.columns() .filter(col -> col.getAsString(ORIGINAL_TYPE).filter("INTEGER"::equalsIgnoreCase).isPresent()) .filter(col -> table.primaryKeyColumns().anyMatch(pkc -> DocumentDbUtil.isSame(pkc.findColumn().get(), col))) .forEach(col -> col.mutator().setAutoIncrement(true));
private Column findColumn(PrimaryKeyColumn pkc) { return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
private static Column findColumn(PrimaryKeyColumn pkc) { requireNonNull(pkc); return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
private Column findColumn(PrimaryKeyColumn pkc) { return pkc.findColumn() .orElseThrow(() -> new SpeedmentException( "Cannot find column for " + pkc )); }
/** * Returns the full name used in the database for the specified * {@link PrimaryKeyColumn}. This is typically constructed by combining the * table and the column name with a separator, but that might be different * in different implementations. * * @param pkc the primary key column to retrieve the name of * @return the full name */ default String fullNameOf(PrimaryKeyColumn pkc) { return fullNameOf(pkc.findColumn().orElseThrow(() -> new SpeedmentException("Cannot find column for " + pkc))); }
.noneMatch(col -> table.primaryKeyColumns().anyMatch(pkc -> DocumentDbUtil.isSame(pkc.findColumn().get(), col))) && table.columns().map(Column::getId).noneMatch("rowid"::equalsIgnoreCase)) { final Column column = table.mutator().addNewColumn(); table.columns() .filter(col -> col.getAsString(ORIGINAL_TYPE).filter("INTEGER"::equalsIgnoreCase).isPresent()) .filter(col -> table.primaryKeyColumns().anyMatch(pkc -> DocumentDbUtil.isSame(pkc.findColumn().get(), col))) .forEach(col -> col.mutator().setAutoIncrement(true));