use of org.jnosql.diana.api.column.ColumnCondition in project jnosql-diana by eclipse.
the class BaseQueryBuilder method lteImpl.
protected void lteImpl(Number value) {
requireNonNull(value, "value is required");
ColumnCondition newCondition = ColumnCondition.lte(Column.of(name, value));
appendCondition(newCondition);
}
use of org.jnosql.diana.api.column.ColumnCondition in project jnosql-diana by eclipse.
the class BaseQueryBuilder method gteImpl.
protected void gteImpl(Number value) {
requireNonNull(value, "value is required");
ColumnCondition newCondition = ColumnCondition.gte(Column.of(name, value));
appendCondition(newCondition);
}
use of org.jnosql.diana.api.column.ColumnCondition in project jnosql-diana-driver by eclipse.
the class HBaseColumnFamilyManager method select.
@Override
public List<ColumnEntity> select(ColumnQuery query) {
Objects.requireNonNull(query, "query is required");
ColumnCondition condition = query.getCondition().orElseThrow(() -> new IllegalArgumentException("Condition is required"));
checkedCondition(condition);
return Stream.of(findById(condition)).map(EntityUnit::new).filter(EntityUnit::isNotEmpty).map(EntityUnit::toEntity).collect(toList());
}
use of org.jnosql.diana.api.column.ColumnCondition in project jnosql-artemis by eclipse.
the class DefaultColumnTemplateTest method shouldDeleteEntity.
@Test
public void shouldDeleteEntity() {
subject.delete(Person.class, "10");
ArgumentCaptor<ColumnDeleteQuery> queryCaptor = ArgumentCaptor.forClass(ColumnDeleteQuery.class);
verify(managerMock).delete(queryCaptor.capture());
ColumnDeleteQuery query = queryCaptor.getValue();
ColumnCondition condition = query.getCondition().get();
assertEquals("Person", query.getColumnFamily());
assertEquals(ColumnCondition.eq(Column.of("_id", 10L)), condition);
}
use of org.jnosql.diana.api.column.ColumnCondition in project jnosql-artemis by eclipse.
the class DefaultColumnTemplateTest method shouldReturnFind.
@Test
public void shouldReturnFind() {
subject.find(Person.class, "10");
ArgumentCaptor<ColumnQuery> queryCaptor = ArgumentCaptor.forClass(ColumnQuery.class);
verify(managerMock).select(queryCaptor.capture());
ColumnQuery query = queryCaptor.getValue();
ColumnCondition condition = query.getCondition().get();
assertEquals("Person", query.getColumnFamily());
assertEquals(ColumnCondition.eq(Column.of("_id", 10L)), condition);
}
Aggregations