Search in sources :

Example 1 with ColumnMapperFrom

use of jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom in project jnosql-diana by eclipse.

the class DefaultColumnQueryMapperBuilderTest method shouldReturnSelectFrom.

@Test
public void shouldReturnSelectFrom() {
    ColumnMapperFrom columnFrom = mapperBuilder.selectFrom(Person.class);
    assertNotNull(columnFrom);
}
Also used : ColumnMapperFrom(jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom) Test(org.junit.jupiter.api.Test)

Example 2 with ColumnMapperFrom

use of jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom in project jnosql-diana by eclipse.

the class DefaultColumnMapperSelectBuilderTest method shouldReturnSelectStarFrom.

@Test
public void shouldReturnSelectStarFrom() {
    ColumnMapperFrom columnFrom = mapperBuilder.selectFrom(Person.class);
    ColumnQuery query = columnFrom.build();
    ColumnQuery queryExpected = select().from("Person").build();
    assertEquals(queryExpected, query);
}
Also used : ColumnQuery(jakarta.nosql.column.ColumnQuery) ColumnMapperFrom(jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom) Test(org.junit.jupiter.api.Test)

Example 3 with ColumnMapperFrom

use of jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom in project jnosql-diana by eclipse.

the class DefaultColumnMapperSelectBuilderTest method shouldCreateQueryWithPagination.

@Test
public void shouldCreateQueryWithPagination() {
    Pagination pagination = Pagination.page(2).size(2);
    ColumnMapperFrom columnFrom = mapperBuilder.selectFrom(Person.class);
    ColumnQuery query = columnFrom.build(pagination);
    assertEquals(pagination.getLimit(), query.getLimit());
    assertEquals(pagination.getSkip(), query.getSkip());
}
Also used : Pagination(jakarta.nosql.mapping.Pagination) ColumnQueryPagination(jakarta.nosql.mapping.column.ColumnQueryPagination) ColumnQuery(jakarta.nosql.column.ColumnQuery) ColumnMapperFrom(jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom) Test(org.junit.jupiter.api.Test)

Aggregations

ColumnMapperFrom (jakarta.nosql.mapping.column.ColumnQueryMapper.ColumnMapperFrom)3 Test (org.junit.jupiter.api.Test)3 ColumnQuery (jakarta.nosql.column.ColumnQuery)2 Pagination (jakarta.nosql.mapping.Pagination)1 ColumnQueryPagination (jakarta.nosql.mapping.column.ColumnQueryPagination)1