use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldSelectStart.
@Test
public void shouldSelectStart() {
ColumnQuery query = mapperBuilder.selectFrom(Worker.class).start(10).build();
ColumnQuery queryExpected = select().from("Worker").start(10L).build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldSelectWhereNameBetween.
@Test
public void shouldSelectWhereNameBetween() {
ColumnQuery query = mapperBuilder.selectFrom(Person.class).where("id").between(10, 20).build();
ColumnQuery queryExpected = select().from("Person").where("_id").between(10L, 20L).build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldSelectWhereNameEq.
@Test
public void shouldSelectWhereNameEq() {
ColumnQuery query = mapperBuilder.selectFrom(Person.class).where("name").eq("Ada").build();
ColumnQuery queryExpected = select().from("Person").where("name").eq("Ada").build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldUseAttibuteConverter.
@Test
public void shouldUseAttibuteConverter() {
ColumnQuery query = mapperBuilder.selectFrom(Worker.class).where("salary").eq(new Money("USD", BigDecimal.TEN)).build();
ColumnQuery queryExpected = select().from("Worker").where("money").eq("USD 10").build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.column.ColumnQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldQueryByEmbeddable.
@Test
public void shouldQueryByEmbeddable() {
ColumnQuery query = mapperBuilder.selectFrom(Worker.class).where("job.city").eq("Salvador").build();
ColumnQuery queryExpected = select().from("Worker").where("job.city").eq("Salvador").build();
assertEquals(queryExpected, query);
}
Aggregations