Search in sources :

Example 1 with RangePoJo

use of io.helidon.tests.integration.dbclient.common.utils.RangePoJo in project helidon by oracle.

the class GetStatementIT method testGetMappedNamedParam.

/**
 * Verify {@code namedParam(Object parameters)} mapped parameters setting method.
 *
 * @throws ExecutionException when database query failed
 * @throws InterruptedException if the current thread was interrupted
 */
@Test
public void testGetMappedNamedParam() throws ExecutionException, InterruptedException {
    RangePoJo range = new RangePoJo(0, 2);
    Optional<DbRow> maybeRow = DB_CLIENT.execute(exec -> exec.createNamedGet("select-pokemons-idrng-named-arg").namedParam(range).execute()).toCompletableFuture().get();
    verifyPokemonsIdRange(maybeRow, 0, 2);
}
Also used : DbRow(io.helidon.dbclient.DbRow) RangePoJo(io.helidon.tests.integration.dbclient.common.utils.RangePoJo) Test(org.junit.jupiter.api.Test)

Example 2 with RangePoJo

use of io.helidon.tests.integration.dbclient.common.utils.RangePoJo in project helidon by oracle.

the class QueryStatementIT method testQueryMappedOrderParam.

/**
 * Verify {@code indexedParam(Object parameters)} mapped parameters setting method.
 */
@Test
public void testQueryMappedOrderParam() {
    RangePoJo range = new RangePoJo(1, 7);
    Multi<DbRow> rows = DB_CLIENT.execute(exec -> exec.createNamedQuery("select-pokemons-idrng-order-arg").indexedParam(range).execute());
    verifyPokemonsIdRange(rows, 1, 7);
}
Also used : DbRow(io.helidon.dbclient.DbRow) RangePoJo(io.helidon.tests.integration.dbclient.common.utils.RangePoJo) Test(org.junit.jupiter.api.Test)

Example 3 with RangePoJo

use of io.helidon.tests.integration.dbclient.common.utils.RangePoJo in project helidon by oracle.

the class GetStatementIT method testGetMappedOrderParam.

/**
 * Verify {@code indexedParam(Object parameters)} mapped parameters setting method.
 *
 * @throws ExecutionException when database query failed
 * @throws InterruptedException if the current thread was interrupted
 */
@Test
public void testGetMappedOrderParam() throws ExecutionException, InterruptedException {
    RangePoJo range = new RangePoJo(6, 8);
    Optional<DbRow> maybeRow = DB_CLIENT.execute(exec -> exec.createNamedGet("select-pokemons-idrng-order-arg").indexedParam(range).execute()).toCompletableFuture().get();
    verifyPokemonsIdRange(maybeRow, 6, 8);
}
Also used : DbRow(io.helidon.dbclient.DbRow) RangePoJo(io.helidon.tests.integration.dbclient.common.utils.RangePoJo) Test(org.junit.jupiter.api.Test)

Example 4 with RangePoJo

use of io.helidon.tests.integration.dbclient.common.utils.RangePoJo in project helidon by oracle.

the class QueryStatementIT method testQueryMappedNamedParam.

/**
 * Verify {@code namedParam(Object parameters)} mapped parameters setting method.
 */
@Test
public void testQueryMappedNamedParam() {
    RangePoJo range = new RangePoJo(1, 7);
    Multi<DbRow> rows = DB_CLIENT.execute(exec -> exec.createNamedQuery("select-pokemons-idrng-named-arg").namedParam(range).execute());
    verifyPokemonsIdRange(rows, 1, 7);
}
Also used : DbRow(io.helidon.dbclient.DbRow) RangePoJo(io.helidon.tests.integration.dbclient.common.utils.RangePoJo) Test(org.junit.jupiter.api.Test)

Aggregations

DbRow (io.helidon.dbclient.DbRow)4 RangePoJo (io.helidon.tests.integration.dbclient.common.utils.RangePoJo)4 Test (org.junit.jupiter.api.Test)4