Search in sources :

Example 36 with DocumentDeleteQuery

use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameLt.

@Test
public void shouldSelectWhereNameLt() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").lt(10).build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("_id").lt(10L).build();
    assertEquals(queryExpected, query);
}
Also used : Person(org.jnosql.artemis.model.Person) DocumentDeleteQuery(org.jnosql.diana.api.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 37 with DocumentDeleteQuery

use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldSelectWhereNameOr.

@Test
public void shouldSelectWhereNameOr() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Person.class).where("id").between(10, 20).or("name").eq("Ada").build();
    DocumentDeleteQuery queryExpected = delete().from("Person").where("_id").between(10L, 20L).or("name").eq("Ada").build();
    assertEquals(queryExpected, query);
}
Also used : Person(org.jnosql.artemis.model.Person) DocumentDeleteQuery(org.jnosql.diana.api.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 38 with DocumentDeleteQuery

use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldReturnDeleteFrom.

@Test
public void shouldReturnDeleteFrom() {
    DocumentDeleteFrom DocumentFrom = mapperBuilder.deleteFrom(Person.class);
    DocumentDeleteQuery query = DocumentFrom.build();
    DocumentDeleteQuery queryExpected = delete().from("Person").build();
    assertEquals(queryExpected, query);
}
Also used : DocumentDeleteFrom(org.jnosql.diana.api.document.query.DocumentDeleteFrom) DocumentDeleteQuery(org.jnosql.diana.api.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 39 with DocumentDeleteQuery

use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis by eclipse.

the class DefaultDocumentMapperDeleteBuilderTest method shouldQueryByEmbeddable.

@Test
public void shouldQueryByEmbeddable() {
    DocumentDeleteQuery query = mapperBuilder.deleteFrom(Worker.class).where("job.city").eq("Salvador").build();
    DocumentDeleteQuery queryExpected = delete().from("Worker").where("job.city").eq("Salvador").build();
    assertEquals(queryExpected, query);
}
Also used : Worker(org.jnosql.artemis.model.Worker) DocumentDeleteQuery(org.jnosql.diana.api.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Example 40 with DocumentDeleteQuery

use of org.jnosql.diana.api.document.DocumentDeleteQuery in project jnosql-artemis 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(org.jnosql.artemis.model.Person) DocumentDeleteQuery(org.jnosql.diana.api.document.DocumentDeleteQuery) Test(org.junit.jupiter.api.Test)

Aggregations

DocumentDeleteQuery (org.jnosql.diana.api.document.DocumentDeleteQuery)86 Test (org.junit.jupiter.api.Test)74 Document (org.jnosql.diana.api.document.Document)35 DocumentEntity (org.jnosql.diana.api.document.DocumentEntity)31 DocumentQuery (org.jnosql.diana.api.document.DocumentQuery)31 DocumentCondition (org.jnosql.diana.api.document.DocumentCondition)20 List (java.util.List)15 Person (org.jnosql.artemis.model.Person)13 Duration (java.time.Duration)7 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)6 AtomicReference (java.util.concurrent.atomic.AtomicReference)6 BeforeEach (org.junit.jupiter.api.BeforeEach)6 Optional (java.util.Optional)4 Consumer (java.util.function.Consumer)4 Collectors (java.util.stream.Collectors)4 DocumentQueryBuilder.delete (org.jnosql.diana.api.document.query.DocumentQueryBuilder.delete)4 DocumentQueryBuilder.select (org.jnosql.diana.api.document.query.DocumentQueryBuilder.select)4 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)4 Assertions.assertNotNull (org.junit.jupiter.api.Assertions.assertNotNull)4 Arrays (java.util.Arrays)3