use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class ColumnRepositoryAsyncProxyTest method shouldExecuteDeleteQuery.
@Test
public void shouldExecuteDeleteQuery() {
ArgumentCaptor<ColumnDeleteQuery> captor = ArgumentCaptor.forClass(ColumnDeleteQuery.class);
ColumnDeleteQuery deleteQuery = delete().from("Person").where("name").eq("Ada").build();
personRepository.deleteQuery(deleteQuery);
verify(template).delete(captor.capture());
assertEquals(deleteQuery, captor.getValue());
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class ColumnRepositoryProxyTest method shouldDeleteQuery.
@Test
public void shouldDeleteQuery() {
ArgumentCaptor<ColumnDeleteQuery> captor = ArgumentCaptor.forClass(ColumnDeleteQuery.class);
ColumnDeleteQuery query = delete().from("Person").where("name").eq("Ada").build();
personRepository.deleteQuery(query);
verify(template).delete(captor.capture());
assertEquals(query, captor.getValue());
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class ColumnRepositoryProxyTest method shouldDeleteByName.
@Test
public void shouldDeleteByName() {
ArgumentCaptor<ColumnDeleteQuery> captor = ArgumentCaptor.forClass(ColumnDeleteQuery.class);
personRepository.deleteByName("Ada");
verify(template).delete(captor.capture());
ColumnDeleteQuery deleteQuery = captor.getValue();
ColumnCondition condition = deleteQuery.getCondition().get();
assertEquals("Person", deleteQuery.getColumnFamily());
assertEquals(Condition.EQUALS, condition.getCondition());
assertEquals(Column.of("name", "Ada"), condition.getColumn());
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperDeleteBuilderTest method shouldSelectWhereNameAnd.
@Test
public void shouldSelectWhereNameAnd() {
ColumnDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("age").between(10, 20).and("name").eq("Ada").build();
ColumnDeleteQuery queryExpected = delete().from("Person").where("age").between(10, 20).and("name").eq("Ada").build();
assertEquals(queryExpected, query);
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class DefaultColumnMapperDeleteBuilderTest method shouldSelectWhereNameGte.
@Test
public void shouldSelectWhereNameGte() {
ColumnDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").gte(10).build();
ColumnDeleteQuery queryExpected = delete().from("Person").where("_id").gte(10L).build();
assertEquals(queryExpected, query);
}
Aggregations