@Test void inWhereClause() { when(widgetTable.qualifiedName()).thenReturn("SCHEMA.WIDGET"); when(widgetTable.rowType()).thenReturn(TypeToken.of(WidgetRow.class)); Alias<WidgetRow> sut = Alias.of(widgetTable, "bob"); String result = sut.inWhereClause(); assertThat(result, is("SCHEMA.WIDGET bob")); }
public String inWhereClause() { if (isDual()) { return table.database().dialect().dual(); } return aliasName .map(a -> String.format("%s %s", table.qualifiedName(), a)) .orElseGet(table::qualifiedName); }
Alias { public String inWhereClause() { if (isDual()) { return table.database().dialect().dual(); } return aliasName .map(a -> String.format("%s %s", table.qualifiedName(), a)) .orElseGet(table::qualifiedName); } }
Alias { public String inWhereClause() { if (isDual()) { return table.database().dialect().dual(); } return aliasName .map(a -> String.format("%s %s", table.qualifiedName(), a)) .orElseGet(table::qualifiedName); } protected  Alias(Table<R> table, Optional<String> aliasName); }
Alias { public String inWhereClause() { if (isDual()) { return table.database().dialect().dual(); } return aliasName .map(a -> String.format("%s %s", table.qualifiedName(), a)) .orElseGet(table::qualifiedName); } protected  Alias(Table<R> table, Optional<String> aliasName); @Override boolean equals(Object o); @Override int hashCode(); TypeToken<R> type(); String inWhereClause(); String inSelectClauseSql(String columnName); String inSelectClauseLabel(String columnName); ExpressionBuilder<T,BooleanExpression> column(Function1<R,T> getter); ExpressionBuilder<T,BooleanExpression> column(FunctionOptional1<R,T> getter); Table<R> table(); Optional<String> aliasName(); Column<T,R> column(MethodInfo<R,T> methodInfo); RowMapper<R> rowMapper(); DynamicRowMapper<R> dynamicRowMapper(); static Alias<U> of(Table<U> table); static Alias<U> of(Table<U> table, String aliasName); }
Alias { public String inWhereClause() { if (isDual()) { return table.database().dialect().dual(); } return aliasName .map(a -> String.format("%s %s", table.qualifiedName(), a)) .orElseGet(table::qualifiedName); } protected  Alias(Table<R> table, Optional<String> aliasName); @Override boolean equals(Object o); @Override int hashCode(); TypeToken<R> type(); String inWhereClause(); String inSelectClauseSql(String columnName); String inSelectClauseLabel(String columnName); ExpressionBuilder<T,BooleanExpression> column(Function1<R,T> getter); ExpressionBuilder<T,BooleanExpression> column(FunctionOptional1<R,T> getter); Table<R> table(); Optional<String> aliasName(); Column<T,R> column(MethodInfo<R,T> methodInfo); RowMapper<R> rowMapper(); DynamicRowMapper<R> dynamicRowMapper(); static Alias<U> of(Table<U> table); static Alias<U> of(Table<U> table, String aliasName);  }