public Table<R> rename(String rename) { return new TableImpl<R>(rename, getSchema()); }
public Table<R> rename(Name rename) { return new TableImpl<R>(rename, getSchema()); }
@Override public boolean equals(Object that) { if (this == that) { return true; } // [#2144] TableImpl equality can be decided without executing the // rather expensive implementation of AbstractQueryPart.equals() if (that instanceof TableImpl) { TableImpl<?> other = (TableImpl<?>) that; return StringUtils.equals(getSchema(), other.getSchema()) && StringUtils.equals(getName(), other.getName()) && Arrays.equals(parameters, other.parameters); } return super.equals(that); } }
@Override public boolean equals(Object that) { if (this == that) { return true; } // [#2144] TableImpl equality can be decided without executing the // rather expensive implementation of AbstractQueryPart.equals() if (that instanceof TableImpl) { TableImpl<?> other = (TableImpl<?>) that; return StringUtils.equals(getSchema(), other.getSchema()) && StringUtils.equals(getName(), other.getName()) && Arrays.equals(parameters, other.parameters); } return super.equals(that); } }
private void accept0(Context<?> ctx) { if (ctx.declareTables()) ctx.scopeMarkStart(this); if (ctx.qualify() && (!NO_SUPPORT_QUALIFIED_TVF_CALLS.contains(ctx.family()) || parameters == null || ctx.declareTables())) { Schema mappedSchema = Tools.getMappedSchema(ctx.configuration(), getSchema()); if (mappedSchema != null && !"".equals(mappedSchema.getName())) { ctx.visit(mappedSchema); ctx.sql('.'); } } ctx.visit(Tools.getMappedTable(ctx.configuration(), this).getUnqualifiedName()); if (parameters != null && ctx.declareTables()) { // [#2925] Some dialects don't like empty parameter lists if (ctx.family() == FIREBIRD && parameters.length == 0) ctx.visit(new QueryPartList<Field<?>>(parameters)); else ctx.sql('(') .visit(new QueryPartList<Field<?>>(parameters)) .sql(')'); } if (ctx.declareTables()) ctx.scopeMarkEnd(this); }
@Override public final void toSQL(RenderContext context) { if (alias != null) { alias.toSQL(context); } else { if (context.qualify()) { Schema mappedSchema = Utils.getMappedSchema(context.configuration(), getSchema()); if (mappedSchema != null) { context.visit(mappedSchema); context.sql("."); } } context.literal(Utils.getMappedTable(context.configuration(), this).getName()); if (parameters != null && context.declareTables()) { context.sql("(") .visit(new QueryPartList<Field<?>>(parameters)) .sql(")"); } } }