@Test void args() { SelectStatement<Integer> sut = new SelectStatement<>(createScope(), TypeToken.of(Integer.class), from, rowMapper, projection); when(projection.args(any())).thenReturn(Stream.of("ABC")); when(from.args(any())).thenReturn(Stream.of(1, 2.4)); Stream<Object> result = sut.args(sut.scope()); assertThat(result.toArray(), arrayContaining("ABC", 1, 2.4)); }
Stream<Object> args(Scope outerScope) { Scope innerScope = outerScope.plus(scope); return Stream.of( cteArgs(outerScope), projection.args(innerScope), from.args(innerScope), whereClauseArgs(innerScope), groupByClauseArgs(innerScope), havingClauseArgs(innerScope), unionsArgs(innerScope) ).flatMap(Function.identity()); }
SelectStatement { Stream<Object> args(Scope outerScope) { Scope innerScope = outerScope.plus(scope); return Stream.of( cteArgs(outerScope), projection.args(innerScope), from.args(innerScope), whereClauseArgs(innerScope), groupByClauseArgs(innerScope), havingClauseArgs(innerScope), unionsArgs(innerScope) ).flatMap(Function.identity()); } }
SelectStatement { Stream<Object> args(Scope outerScope) { Scope innerScope = outerScope.plus(scope); return Stream.of( cteArgs(outerScope), projection.args(innerScope), from.args(innerScope), whereClauseArgs(innerScope), groupByClauseArgs(innerScope), havingClauseArgs(innerScope), unionsArgs(innerScope) ).flatMap(Function.identity()); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); }
SelectStatement { Stream<Object> args(Scope outerScope) { Scope innerScope = outerScope.plus(scope); return Stream.of( cteArgs(outerScope), projection.args(innerScope), from.args(innerScope), whereClauseArgs(innerScope), groupByClauseArgs(innerScope), havingClauseArgs(innerScope), unionsArgs(innerScope) ).flatMap(Function.identity()); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions(); }
SelectStatement { Stream<Object> args(Scope outerScope) { Scope innerScope = outerScope.plus(scope); return Stream.of( cteArgs(outerScope), projection.args(innerScope), from.args(innerScope), whereClauseArgs(innerScope), groupByClauseArgs(innerScope), havingClauseArgs(innerScope), unionsArgs(innerScope) ).flatMap(Function.identity()); } SelectStatement(Scope scope, TypeToken<RT> rowType, From from, RowMapper<RT> rowMapper, Projection projection); TypeToken<RT> rowType(); Stream<CommonTableExpression<?>> commonTableExpressions();  }