use of org.jnosql.diana.api.document.Document in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldSelectWhereNameGte.
@Test
public void shouldSelectWhereNameGte() {
String documentCollection = "documentCollection";
Number value = 10;
DocumentQuery query = select().from(documentCollection).where("name").gte(value).build();
DocumentCondition condition = query.getCondition().get();
Document document = condition.getDocument();
assertTrue(query.getDocuments().isEmpty());
assertEquals(documentCollection, query.getDocumentCollection());
assertEquals(Condition.GREATER_EQUALS_THAN, condition.getCondition());
assertEquals("name", document.getName());
assertEquals(value, document.get());
}
use of org.jnosql.diana.api.document.Document in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldSelectWhereNameLt.
@Test
public void shouldSelectWhereNameLt() {
String documentCollection = "documentCollection";
Number value = 10;
DocumentQuery query = select().from(documentCollection).where("name").lt(value).build();
DocumentCondition condition = query.getCondition().get();
Document document = condition.getDocument();
assertTrue(query.getDocuments().isEmpty());
assertEquals(documentCollection, query.getDocumentCollection());
assertEquals(Condition.LESSER_THAN, condition.getCondition());
assertEquals("name", document.getName());
assertEquals(value, document.get());
}
use of org.jnosql.diana.api.document.Document in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldSelectWhereNameLike.
@Test
public void shouldSelectWhereNameLike() {
String documentCollection = "documentCollection";
String name = "Ada Lovelace";
DocumentQuery query = select().from(documentCollection).where("name").like(name).build();
DocumentCondition condition = query.getCondition().get();
Document document = condition.getDocument();
assertTrue(query.getDocuments().isEmpty());
assertEquals(documentCollection, query.getDocumentCollection());
assertEquals(Condition.LIKE, condition.getCondition());
assertEquals("name", document.getName());
assertEquals(name, document.get());
}
use of org.jnosql.diana.api.document.Document in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldSelectWhereNameLte.
@Test
public void shouldSelectWhereNameLte() {
String documentCollection = "documentCollection";
Number value = 10;
DocumentQuery query = select().from(documentCollection).where("name").lte(value).build();
DocumentCondition condition = query.getCondition().get();
Document document = condition.getDocument();
assertTrue(query.getDocuments().isEmpty());
assertEquals(documentCollection, query.getDocumentCollection());
assertEquals(Condition.LESSER_EQUALS_THAN, condition.getCondition());
assertEquals("name", document.getName());
assertEquals(value, document.get());
}
use of org.jnosql.diana.api.document.Document in project jnosql-diana by eclipse.
the class DefaultSelectQueryBuilderTest method shouldSelectWhereNameGt.
@Test
public void shouldSelectWhereNameGt() {
String documentCollection = "documentCollection";
Number value = 10;
DocumentQuery query = select().from(documentCollection).where("name").gt(value).build();
DocumentCondition condition = query.getCondition().get();
Document document = condition.getDocument();
assertTrue(query.getDocuments().isEmpty());
assertEquals(documentCollection, query.getDocumentCollection());
assertEquals(Condition.GREATER_THAN, condition.getCondition());
assertEquals("name", document.getName());
assertEquals(value, document.get());
}
Aggregations