use of org.jnosql.diana.api.document.DocumentQuery in project jnosql-artemis by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectOrderDesc.
@Test
public void shouldSelectOrderDesc() {
DocumentQuery query = mapperBuilder.selectFrom(Worker.class).orderBy("salary").desc().build();
DocumentQuery queryExpected = select().from("Worker").orderBy("money").desc().build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.document.DocumentQuery in project jnosql-artemis by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectWhereNameNot.
@Test
public void shouldSelectWhereNameNot() {
DocumentQuery query = mapperBuilder.selectFrom(Person.class).where("name").not().like("Ada").build();
DocumentQuery queryExpected = select().from("Person").where("name").not().like("Ada").build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.document.DocumentQuery in project jnosql-artemis by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectWhereNameEq.
@Test
public void shouldSelectWhereNameEq() {
DocumentQuery query = mapperBuilder.selectFrom(Person.class).where("name").eq("Ada").build();
DocumentQuery queryExpected = select().from("Person").where("name").eq("Ada").build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.document.DocumentQuery in project jnosql-artemis by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectOrderAsc.
@Test
public void shouldSelectOrderAsc() {
DocumentQuery query = mapperBuilder.selectFrom(Worker.class).orderBy("salary").asc().build();
DocumentQuery queryExpected = select().from("Worker").orderBy("money").asc().build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.document.DocumentQuery in project jnosql-artemis by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectWhereNameOr.
@Test
public void shouldSelectWhereNameOr() {
DocumentQuery query = mapperBuilder.selectFrom(Person.class).where("id").between(10, 20).or("name").eq("Ada").build();
DocumentQuery queryExpected = select().from("Person").where("_id").between(10L, 20L).or("name").eq("Ada").build();
assertEquals(queryExpected, query);
}
Aggregations