Search in sources :

Example 81 with DocumentDeleteQuery

use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameGt.

@Test
public void shouldSelectWhereNameGt() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").gt(10).build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("_id").gt(10L).build();
    assertEquals(queryExpected, query);
}
Also used : Person(jakarta.nosql.tck.entities.Person) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 82 with DocumentDeleteQuery

use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameNot.

@Test
public void shouldSelectWhereNameNot() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("name").not().like("Ada").build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("name").not().like("Ada").build();
    assertEquals(queryExpected, query);
}
Also used : DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 83 with DocumentDeleteQuery

use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldConvertField.

@Test
public void shouldConvertField() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").eq("20").build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("_id").eq(20L).build();
    assertEquals(queryExpected, query);
}
Also used : Person(jakarta.nosql.tck.entities.Person) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 84 with DocumentDeleteQuery

use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameLte.

@Test
public void shouldSelectWhereNameLte() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").lte(10).build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("_id").lte(10L).build();
    assertEquals(queryExpected, query);
}
Also used : Person(jakarta.nosql.tck.entities.Person) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 85 with DocumentDeleteQuery

use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameLike.

@Test
public void shouldSelectWhereNameLike() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("name").like("Ada").build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("name").like("Ada").build();
    assertEquals(queryExpected, query);
}
Also used : Person(jakarta.nosql.tck.entities.Person) DocumentDeleteQuery(jakarta.nosql.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentDeleteQuery (jakarta.nosql.document.DocumentDeleteQuery)114 Test (org.junit.jupiter.api.Test)79 DocumentEntity (jakarta.nosql.document.DocumentEntity)45 DocumentQuery (jakarta.nosql.document.DocumentQuery)43 Document (jakarta.nosql.document.Document)37 DocumentCondition (jakarta.nosql.document.DocumentCondition)33 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)20 ValueSource (org.junit.jupiter.params.provider.ValueSource)20 List (java.util.List)15 Person (jakarta.nosql.tck.entities.Person)12 Collectors (java.util.stream.Collectors)7 Params (jakarta.nosql.Params)5 DocumentDeleteQueryParams (jakarta.nosql.document.DocumentDeleteQueryParams)5 Duration (java.time.Duration)5 HashMap (java.util.HashMap)5 Optional (java.util.Optional)5 StreamSupport (java.util.stream.StreamSupport)5 DocumentCollectionManager (jakarta.nosql.document.DocumentCollectionManager)4 DocumentQuery.select (jakarta.nosql.document.DocumentQuery.select)4 Map (java.util.Map)4