public static String sqlTableReference(DatabaseNamingConvention naming, Table table) { requireNonNulls(naming, table); return naming.fullNameOf(table); }
/** * 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))); }
naming.fullNameOf(table), naming.quoteField(columnName) );
/** * Returns the full name used in the database for the specified * ColumnIdentifier. This is typically constructed by combining the schema, * table and column name with a separator, but that might be different in * different implementations. * * @param fieldIdentifier to use * @return the full name */ default String fullNameOf(ColumnIdentifier<?> fieldIdentifier) { return fullNameOf(fieldIdentifier.getSchemaId(), fieldIdentifier.getTableId(), fieldIdentifier.getColumnId()); }
naming.fullNameOf(table), naming.quoteField(columnName) );
/** * Returns the full name used in the database for the specified * {@link Table}. This is typically constructed by combining the schema and * the table name with a separator, but that might be different in different * implementations. * * @param table the table to retrieve the name of * @return the full name */ default String fullNameOf(Table table) { final Schema schema = table.getParentOrThrow(); return fullNameOf(schema.getName(), table.getName()); }
SqlStage( final SqlInfo info, final Stage<?> stage, final int stageIndex ) { requireNonNull(info); this.stage = requireNonNull(stage); this.stageIndex = requireNonNegative(stageIndex); this.table = DocumentDbUtil.referencedTable(info.project(), stage.identifier()); final String tableAlias = JoinSqlUtil.tableAlias(stageIndex); this.sqlColumnList = table.columns() .filter(Column::isEnabled) .map(Column::getName) .map(n -> tableAlias + "." + info.namingConvention().encloseField(n)) .collect(joining(",")); this.sqlTableReference = info.namingConvention().fullNameOf(table) + (DbmsType.SubSelectAlias.PROHIBITED.equals(info.dbmsType().getSubSelectAlias()) ? " " : " AS ") + tableAlias; }
.collect(joining(",")); this.sqlTableReference = naming.fullNameOf(table); this.sqlSelect = "SELECT " + sqlColumnList + " FROM " + sqlTableReference; this.sqlSelectCount = "SELECT COUNT(*) FROM " + sqlTableReference;
/** * Returns the full name used in the database for the specified * {@link Column}. This is typically constructed by combining the table and * the column name with a separator, but that might be different in * different implementations. * * @param column the column to retrieve the name of * @return the full name */ default String fullNameOf(Column column) { final Table table = column.getParentOrThrow(); final Schema schema = table.getParentOrThrow(); return fullNameOf(schema.getName(), table.getName(), column.getName()); }
this.entityClass = manager.getEntityClass(); this.sqlTableReference = naming.fullNameOf(table); this.hasPrimaryKeyColumns = manager.primaryKeyFields().anyMatch(m -> true);
this.entityClass = tableInfo.getEntityClass(); this.sqlTableReference = naming.fullNameOf(table); this.hasPrimaryKeyColumns = tableInfo.primaryKeyFields().anyMatch(m -> true);
public static String sqlTableReference(DatabaseNamingConvention naming, Table table) { requireNonNulls(naming, table); return naming.fullNameOf(table); }
/** * 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))); }
naming.fullNameOf(table), naming.quoteField(columnName) );
naming.fullNameOf(table), naming.quoteField(columnName) );
/** * Returns the full name used in the database for the specified * ColumnIdentifier. This is typically constructed by combining the schema, * table and column name with a separator, but that might be different in * different implementations. * * @param fieldIdentifier to use * @return the full name */ default String fullNameOf(ColumnIdentifier<?> fieldIdentifier) { return fullNameOf(fieldIdentifier.getSchemaId(), fieldIdentifier.getTableId(), fieldIdentifier.getColumnId()); }
/** * Returns the full name used in the database for the specified * {@link Table}. This is typically constructed by combining the schema and * the table name with a separator, but that might be different in different * implementations. * * @param table the table to retrieve the name of * @return the full name */ default String fullNameOf(Table table) { final Schema schema = table.getParentOrThrow(); return fullNameOf(schema.getName(), table.getName()); }
SqlStage( final SqlInfo info, final Stage<?> stage, final int stageIndex ) { requireNonNull(info); this.stage = requireNonNull(stage); this.stageIndex = requireNonNegative(stageIndex); this.table = DocumentDbUtil.referencedTable(info.project(), stage.identifier()); final String tableAlias = JoinSqlUtil.tableAlias(stageIndex); this.sqlColumnList = table.columns() .filter(Column::isEnabled) .map(Column::getName) .map(n -> tableAlias + "." + info.namingConvention().encloseField(n)) .collect(joining(",")); this.sqlTableReference = info.namingConvention().fullNameOf(table) + (DbmsType.SubSelectAlias.PROHIBITED.equals(info.dbmsType().getSubSelectAlias()) ? " " : " AS ") + tableAlias; }
/** * Returns the full name used in the database for the specified * {@link Column}. This is typically constructed by combining the table and * the column name with a separator, but that might be different in * different implementations. * * @param column the column to retrieve the name of * @return the full name */ default String fullNameOf(Column column) { final Table table = column.getParentOrThrow(); final Schema schema = table.getParentOrThrow(); return fullNameOf(schema.getName(), table.getName(), column.getName()); }
this.entityClass = tableInfo.getEntityClass(); this.sqlTableReference = naming.fullNameOf(table); this.hasPrimaryKeyColumns = tableInfo.primaryKeyFields().anyMatch(m -> true);