use of jakarta.nosql.column.ColumnDeleteQuery in project jnosql-diana 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 jakarta.nosql.column.ColumnDeleteQuery in project jnosql-diana by eclipse.
the class DefaultColumnEventPersistManagerTest method shouldFirePreDeleteQuery.
@Test
public void shouldFirePreDeleteQuery() {
ColumnDeleteQuery query = delete().from("person").build();
subject.firePreDeleteQuery(query);
ArgumentCaptor<ColumnDeleteQueryExecute> captor = ArgumentCaptor.forClass(ColumnDeleteQueryExecute.class);
verify(columnDeleteQueryExecute).fire(captor.capture());
assertEquals(query, captor.getValue().getQuery());
}
use of jakarta.nosql.column.ColumnDeleteQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperDeleteBuilderTest method shouldSelectWhereNameLte.
@Test
public void shouldSelectWhereNameLte() {
ColumnDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").lte(10).build();
ColumnDeleteQuery queryExpected = delete().from("Person").where("_id").lte(10L).build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.column.ColumnDeleteQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperDeleteBuilderTest method shouldSelectWhereNameBetween.
@Test
public void shouldSelectWhereNameBetween() {
ColumnDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").between(10, 20).build();
ColumnDeleteQuery queryExpected = delete().from("Person").where("_id").between(10L, 20L).build();
assertEquals(queryExpected, query);
}
use of jakarta.nosql.column.ColumnDeleteQuery in project jnosql-diana by eclipse.
the class DefaultColumnMapperDeleteBuilderTest method shouldQueryBySubEntity.
@Test
public void shouldQueryBySubEntity() {
ColumnDeleteQuery query = mapperBuilder.deleteFrom(Address.class).where("zipCode.zip").eq("01312321").build();
ColumnDeleteQuery queryExpected = delete().from("Address").where("zipCode.zip").eq("01312321").build();
assertEquals(queryExpected, query);
}
Aggregations