use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class AbstractMapperQuery 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 AbstractMapperQuery method lteImpl.
protected <T> void lteImpl(T value) {
requireNonNull(value, "value is required");
DocumentCondition newCondition = DocumentCondition.lte(Document.of(mapping.getColumnField(name), getValue(value)));
appendCondition(newCondition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class AbstractMapperQuery method betweenImpl.
protected <T> void betweenImpl(T valueA, T valueB) {
requireNonNull(valueA, "valueA is required");
requireNonNull(valueB, "valueB is required");
DocumentCondition newCondition = DocumentCondition.between(Document.of(mapping.getColumnField(name), asList(getValue(valueA), getValue(valueB))));
appendCondition(newCondition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class AbstractMapperQuery method inImpl.
protected <T> void inImpl(Iterable<T> values) {
requireNonNull(values, "values is required");
List<Object> convertedValues = StreamSupport.stream(values.spliterator(), false).map(this::getValue).collect(toList());
DocumentCondition newCondition = DocumentCondition.in(Document.of(mapping.getColumnField(name), convertedValues));
appendCondition(newCondition);
}
use of jakarta.nosql.document.DocumentCondition in project jnosql-diana by eclipse.
the class AbstractMapperQuery method eqImpl.
protected <T> void eqImpl(T value) {
requireNonNull(value, "value is required");
DocumentCondition newCondition = DocumentCondition.eq(Document.of(mapping.getColumnField(name), getValue(value)));
appendCondition(newCondition);
}
Aggregations