use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerAsyncTest method shouldReturnErrorWhenConsistencyIsNull.
@Test
public void shouldReturnErrorWhenConsistencyIsNull() {
ColumnDeleteQuery query = delete().from(COLUMN_FAMILY).build();
assertThrows(NullPointerException.class, () -> {
columnEntityManager.delete(query, (ConsistencyLevel) null);
});
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerAsyncTest method shouldDelete.
@Test
public void shouldDelete() {
ColumnDeleteQuery query = delete().from(COLUMN_FAMILY).where("id").eq(10L).build();
columnEntityManager.delete(query);
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery in project jnosql-diana-driver by eclipse.
the class CassandraColumnFamilyManagerTest method shouldDeleteColumnFamilyWithConsistencyLevel.
@Test
public void shouldDeleteColumnFamilyWithConsistencyLevel() {
entityManager.insert(getColumnFamily());
ColumnEntity.of(COLUMN_FAMILY, singletonList(Columns.of("id", 10L)));
ColumnDeleteQuery deleteQuery = delete().from(COLUMN_FAMILY).where("id").eq(10L).build();
entityManager.delete(deleteQuery, CONSISTENCY_LEVEL);
List<ColumnEntity> entities = entityManager.cql("select * from newKeySpace.newColumnFamily where id=10;");
assertTrue(entities.isEmpty());
}
use of org.jnosql.diana.api.column.ColumnDeleteQuery 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.ColumnDeleteQuery in project jnosql-artemis by eclipse.
the class ColumnQueryDeleteParserTest method shouldDeleteByNameLike.
@Test
public void shouldDeleteByNameLike() {
ColumnDeleteQuery query = parser.parse("deleteByNameLike", new Object[] { "name" }, classRepresentation, converters);
assertEquals("Person", query.getColumnFamily());
assertEquals(Condition.LIKE, query.getCondition().get().getCondition());
assertEquals(Column.of("name", "name"), query.getCondition().get().getColumn());
}
Aggregations