use of jakarta.nosql.column.ColumnQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldExecuteQuery.
@Test
public void shouldExecuteQuery() {
ColumnTemplate template = Mockito.mock(ColumnTemplate.class);
ArgumentCaptor<ColumnQuery> queryCaptor = ArgumentCaptor.forClass(ColumnQuery.class);
mapperBuilder.selectFrom(Person.class).getResult(template);
Mockito.verify(template).select(queryCaptor.capture());
ColumnQuery query = queryCaptor.getValue();
ColumnQuery queryExpected = select().from("Person").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.column.ColumnQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldQueryBySubEntity.
@Test
public void shouldQueryBySubEntity() {
ColumnQuery query = mapperBuilder.selectFrom(Address.class).where("zipCode.zip").eq("01312321").build();
ColumnQuery queryExpected = select().from("Address").where("zipCode.zip").eq("01312321").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.column.ColumnQuery 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);
}
use of jakarta.nosql.column.ColumnQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperSelectBuilderTest method shouldSelectWhereNameLike.
@Test
public void shouldSelectWhereNameLike() {
ColumnQuery query = mapperBuilder.selectFrom(Person.class).where("name").like("Ada").build();
ColumnQuery queryExpected = select().from("Person").where("name").like("Ada").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.column.ColumnQuery in project jnosql-diana 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);
}
Aggregations