Search in sources :

Example 1 with DocumentMapperFrom

use of jakarta.nosql.mapping.document.DocumentQueryMapper.DocumentMapperFrom in project jnosql-diana by eclipse.

the class DefaultDocumentMapperSelectBuilderTest method shouldCreateQueryWithPagination.

@Test
public void shouldCreateQueryWithPagination() {
    Pagination pagination = Pagination.page(2).size(2);
    DocumentMapperFrom columnFrom = mapperBuilder.selectFrom(Person.class);
    DocumentQuery query = columnFrom.build(pagination);
    assertEquals(pagination.getLimit(), query.getLimit());
    assertEquals(pagination.getSkip(), query.getSkip());
}
Also used : DocumentQueryPagination(jakarta.nosql.mapping.document.DocumentQueryPagination) Pagination(jakarta.nosql.mapping.Pagination) DocumentQuery(jakarta.nosql.document.DocumentQuery) DocumentMapperFrom(jakarta.nosql.mapping.document.DocumentQueryMapper.DocumentMapperFrom) Test(org.junit.jupiter.api.Test)

Example 2 with DocumentMapperFrom

use of jakarta.nosql.mapping.document.DocumentQueryMapper.DocumentMapperFrom in project jnosql-diana by eclipse.

the class DefaultDocumentMapperSelectBuilderTest method shouldReturnSelectStarFrom.

@Test
public void shouldReturnSelectStarFrom() {
    DocumentMapperFrom documentFrom = mapperBuilder.selectFrom(Person.class);
    DocumentQuery query = documentFrom.build();
    DocumentQuery queryExpected = select().from("Person").build();
    assertEquals(queryExpected, query);
}
Also used : DocumentQuery(jakarta.nosql.document.DocumentQuery) DocumentMapperFrom(jakarta.nosql.mapping.document.DocumentQueryMapper.DocumentMapperFrom) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentQuery (jakarta.nosql.document.DocumentQuery)2 DocumentMapperFrom (jakarta.nosql.mapping.document.DocumentQueryMapper.DocumentMapperFrom)2 Test (org.junit.jupiter.api.Test)2 Pagination (jakarta.nosql.mapping.Pagination)1 DocumentQueryPagination (jakarta.nosql.mapping.document.DocumentQueryPagination)1