use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class BaseQueryBuilder method appendCondition.
protected void appendCondition(DocumentCondition newCondition) {
DocumentCondition documentCondition = getDocumentCondition(newCondition);
if (nonNull(condition)) {
if (and) {
this.condition = condition.and(documentCondition);
} else {
this.condition = condition.or(documentCondition);
}
} else {
this.condition = documentCondition;
}
this.negate = false;
this.name = null;
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class BaseQueryBuilder method inImpl.
protected <T> void inImpl(Iterable<T> values) {
requireNonNull(values, "values is required");
DocumentCondition newCondition = DocumentCondition.in(Document.of(name, values));
appendCondition(newCondition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class BaseQueryBuilder method likeImpl.
protected void likeImpl(String value) {
requireNonNull(value, "value is required");
DocumentCondition newCondition = DocumentCondition.like(Document.of(name, value));
appendCondition(newCondition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class DefaultDocumentTemplateTest method shouldReturnFind.
@Test
public void shouldReturnFind() {
subject.find(Person.class, "10");
ArgumentCaptor<DocumentQuery> queryCaptor = ArgumentCaptor.forClass(DocumentQuery.class);
verify(managerMock).select(queryCaptor.capture());
DocumentQuery query = queryCaptor.getValue();
DocumentCondition condition = query.getCondition().get();
assertEquals("Person", query.getDocumentCollection());
assertEquals(DocumentCondition.eq(Document.of("_id", 10L)), condition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class AbstractMapperQuery method gteImpl.
protected <T> void gteImpl(T value) {
requireNonNull(value, "value is required");
DocumentCondition newCondition = DocumentCondition.gte(Document.of(mapping.getColumnField(name), getValue(value)));
appendCondition(newCondition);
}
Aggregations