@Test void listWithoutArgsThrowsIfNoDefault() { Select<SalespersonRow> sut = databaseWithNoDefaultSqlExecutor().from(SalespersonRow.class); calling(supplier(sut::list)) .shouldThrow(IllegalStateException.class) .withMessage("Default SQL executor has not been set."); }
public static <R> ExpectingJoin1<R> from(Database database, Alias<R> alias) { SelectStatement<R> select = new SelectStatement<>(new Scope(database, alias), alias.type(), From.from(alias), alias.rowMapper(), Projection.of(alias)); return new ExpectingJoin1<>(select); }
Select implements TypedExpression<RT> { public static <R> ExpectingJoin1<R> from(Database database, Alias<R> alias) { SelectStatement<R> select = new SelectStatement<>(new Scope(database, alias), alias.type(), From.from(alias), alias.rowMapper(), Projection.of(alias)); return new ExpectingJoin1<>(select); } }
Select implements TypedExpression<RT> { public static <R> ExpectingJoin1<R> from(Database database, Alias<R> alias) { SelectStatement<R> select = new SelectStatement<>(new Scope(database, alias), alias.type(), From.from(alias), alias.rowMapper(), Projection.of(alias)); return new ExpectingJoin1<>(select); } Select(SelectStatement<RT> statement); }
Select implements TypedExpression<RT> { public static <R> ExpectingJoin1<R> from(Database database, Alias<R> alias) { SelectStatement<R> select = new SelectStatement<>(new Scope(database, alias), alias.type(), From.from(alias), alias.rowMapper(), Projection.of(alias)); return new ExpectingJoin1<>(select); } Select(SelectStatement<RT> statement); List<RT> list(); List<RT> list(SqlExecutor sqlExecutor); List<RT> list(Transaction transaction); CompletableFuture<List<RT>> listAsync(); CompletableFuture<List<RT>> listAsync(SqlExecutor sqlExecutor); CompletableFuture<List<RT>> listAsync(Transaction transaction); Optional<RT> optional(); Optional<RT> optional(SqlExecutor sqlExecutor); Optional<RT> optional(Transaction transaction); CompletableFuture<Optional<RT>> optionalAsync(); CompletableFuture<Optional<RT>> optionalAsync(SqlExecutor sqlExecutor); CompletableFuture<Optional<RT>> optionalAsync(Transaction transaction); Stream<RT> stream(); Stream<RT> stream(CompositeAutoCloseable compositeAutoCloseable); Stream<RT> stream(SqlExecutor sqlExecutor); Stream<RT> stream(SqlExecutor sqlExecutor, CompositeAutoCloseable compositeAutoCloseable); Stream<RT> stream(Transaction transaction); Stream<RT> stream(Transaction transaction, CompositeAutoCloseable compositeAutoCloseable); RT single(); RT single(SqlExecutor sqlExecutor); RT single(Transaction transaction); CompletableFuture<RT> singleAsync(); CompletableFuture<RT> singleAsync(SqlExecutor sqlExecutor); CompletableFuture<RT> singleAsync(Transaction transaction); Select<RT> fetchFirst(long i); Select<RT> withIsolation(IsolationLevel level); Select<RT> keepLocks(LockLevel level); @Override TypeToken<RT> type(); String sql(); @Override String sql(Scope scope); @Override String label(Scope scope); @Override Precedence precedence(); @Override RowMapper<RT> rowMapper(Scope scope, Optional<String> label); @Override Stream<Object> args(Scope scope); static ExpectingJoin1<R> from(Database database, Alias<R> alias); static ExpectingJoin1<R> from(Database database, CommonTableExpression<R> cte); static ExpectingJoin1<R> from(Database database, CommonTableExpression<R> cte, String aliasName); static ExpectingJoin1<R> from(Database database, Table<R> table); }
Select implements TypedExpression<RT> { public static <R> ExpectingJoin1<R> from(Database database, Alias<R> alias) { SelectStatement<R> select = new SelectStatement<>(new Scope(database, alias), alias.type(), From.from(alias), alias.rowMapper(), Projection.of(alias)); return new ExpectingJoin1<>(select); } Select(SelectStatement<RT> statement); List<RT> list(); List<RT> list(SqlExecutor sqlExecutor); List<RT> list(Transaction transaction); CompletableFuture<List<RT>> listAsync(); CompletableFuture<List<RT>> listAsync(SqlExecutor sqlExecutor); CompletableFuture<List<RT>> listAsync(Transaction transaction); Optional<RT> optional(); Optional<RT> optional(SqlExecutor sqlExecutor); Optional<RT> optional(Transaction transaction); CompletableFuture<Optional<RT>> optionalAsync(); CompletableFuture<Optional<RT>> optionalAsync(SqlExecutor sqlExecutor); CompletableFuture<Optional<RT>> optionalAsync(Transaction transaction); Stream<RT> stream(); Stream<RT> stream(CompositeAutoCloseable compositeAutoCloseable); Stream<RT> stream(SqlExecutor sqlExecutor); Stream<RT> stream(SqlExecutor sqlExecutor, CompositeAutoCloseable compositeAutoCloseable); Stream<RT> stream(Transaction transaction); Stream<RT> stream(Transaction transaction, CompositeAutoCloseable compositeAutoCloseable); RT single(); RT single(SqlExecutor sqlExecutor); RT single(Transaction transaction); CompletableFuture<RT> singleAsync(); CompletableFuture<RT> singleAsync(SqlExecutor sqlExecutor); CompletableFuture<RT> singleAsync(Transaction transaction); Select<RT> fetchFirst(long i); Select<RT> withIsolation(IsolationLevel level); Select<RT> keepLocks(LockLevel level); @Override TypeToken<RT> type(); String sql(); @Override String sql(Scope scope); @Override String label(Scope scope); @Override Precedence precedence(); @Override RowMapper<RT> rowMapper(Scope scope, Optional<String> label); @Override Stream<Object> args(Scope scope); static ExpectingJoin1<R> from(Database database, Alias<R> alias); static ExpectingJoin1<R> from(Database database, CommonTableExpression<R> cte); static ExpectingJoin1<R> from(Database database, CommonTableExpression<R> cte, String aliasName); static ExpectingJoin1<R> from(Database database, Table<R> table);  }