use of jakarta.nosql.document.DocumentQuery in project jnosql-diana by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectWhereNameLike.
@Test
public void shouldSelectWhereNameLike() {
DocumentQuery query = mapperBuilder.selectFrom(Person.class).where("name").like("Ada").build();
DocumentQuery queryExpected = select().from("Person").where("name").like("Ada").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.document.DocumentQuery in project jnosql-diana 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);
}
use of jakarta.nosql.document.DocumentQuery in project jnosql-diana by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldQueryByEmbeddable.
@Test
public void shouldQueryByEmbeddable() {
DocumentQuery query = mapperBuilder.selectFrom(Worker.class).where("job.city").eq("Salvador").build();
DocumentQuery queryExpected = select().from("Worker").where("city").eq("Salvador").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.document.DocumentQuery in project jnosql-diana by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldQueryBySubEntity.
@Test
public void shouldQueryBySubEntity() {
DocumentQuery query = mapperBuilder.selectFrom(Address.class).where("zipCode.zip").eq("01312321").build();
DocumentQuery queryExpected = select().from("Address").where("zipCode.zip").eq("01312321").build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.document.DocumentQuery in project jnosql-diana by eclipse.
the class DefaultDocumentMapperSelectBuilderTest method shouldSelectWhereNameGte.
@Test
public void shouldSelectWhereNameGte() {
DocumentQuery query = mapperBuilder.selectFrom(Person.class).where("id").gte(10).build();
DocumentQuery queryExpected = select().from("Person").where("_id").gte(10L).build();
assertEquals(queryExpected, query);
}
Aggregations