use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana-driver by eclipse.
the class DefaultSolrDocumentCollectionManagerTest method shouldFindDocumentLesserEqualsThan.
@Test
public void shouldFindDocumentLesserEqualsThan() {
DocumentDeleteQuery deleteQuery = delete().from(COLLECTION_NAME).build();
entityManager.delete(deleteQuery);
Iterable<DocumentEntity> entitiesSaved = entityManager.insert(getEntitiesWithValues());
List<DocumentEntity> entities = StreamSupport.stream(entitiesSaved.spliterator(), false).collect(Collectors.toList());
DocumentQuery query = select().from(COLLECTION_NAME).where("age").lte(23).and("type").eq("V").build();
List<DocumentEntity> entitiesFound = entityManager.select(query).collect(Collectors.toList());
assertEquals(2, entitiesFound.size());
}
use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana-driver by eclipse.
the class DefaultSolrDocumentCollectionManagerTest method shouldExecuteNativeQuery.
@Test
public void shouldExecuteNativeQuery() {
DocumentDeleteQuery deleteQuery = delete().from(COLLECTION_NAME).build();
entityManager.delete(deleteQuery);
entityManager.insert(getEntitiesWithValues());
List<DocumentEntity> entitiesFound = entityManager.solr("age:22 AND type:V AND _entity:person");
assertEquals(1, entitiesFound.size());
}
use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana-driver by eclipse.
the class DefaultSolrDocumentCollectionManagerTest method shouldFindDocumentGreaterThan.
@Test
public void shouldFindDocumentGreaterThan() {
DocumentDeleteQuery deleteQuery = delete().from(COLLECTION_NAME).build();
entityManager.delete(deleteQuery);
Iterable<DocumentEntity> entitiesSaved = entityManager.insert(getEntitiesWithValues());
List<DocumentEntity> entities = StreamSupport.stream(entitiesSaved.spliterator(), false).collect(Collectors.toList());
DocumentQuery query = select().from(COLLECTION_NAME).where("age").gt(22).and("type").eq("V").build();
List<DocumentEntity> entitiesFound = entityManager.select(query).collect(Collectors.toList());
assertEquals(3, entitiesFound.size());
}
use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana-driver by eclipse.
the class RavenDBDocumentCollectionManagerTest method shouldFindDocumentIn.
@Test
public void shouldFindDocumentIn() throws InterruptedException {
DocumentDeleteQuery deleteQuery = delete().from(COLLECTION_NAME).where("type").eq("V").build();
entityManager.delete(deleteQuery);
Iterable<DocumentEntity> entitiesSaved = entityManager.insert(getEntitiesWithValues());
List<DocumentEntity> entities = StreamSupport.stream(entitiesSaved.spliterator(), false).collect(Collectors.toList());
DocumentQuery query = select().from(COLLECTION_NAME).where("location").in(asList("BR", "US")).and("type").eq("V").build();
Thread.sleep(TIME_LIMIT);
assertEquals(entities, entityManager.select(query).collect(Collectors.toList()));
}
use of jakarta.nosql.document.DocumentDeleteQuery in project jnosql-diana-driver by eclipse.
the class RavenDBDocumentCollectionManagerTest method shouldFindDocumentGreaterThan.
@Test
public void shouldFindDocumentGreaterThan() throws InterruptedException {
DocumentDeleteQuery deleteQuery = delete().from(COLLECTION_NAME).where("type").eq("V").build();
entityManager.delete(deleteQuery);
Iterable<DocumentEntity> entitiesSaved = entityManager.insert(getEntitiesWithValues());
List<DocumentEntity> entities = StreamSupport.stream(entitiesSaved.spliterator(), false).collect(Collectors.toList());
DocumentQuery query = select().from(COLLECTION_NAME).where("age").gt(22).and("type").eq("V").build();
Thread.sleep(TIME_LIMIT);
List<DocumentEntity> entitiesFound = entityManager.select(query).collect(Collectors.toList());
assertEquals(2, entitiesFound.size());
assertThat(entitiesFound, not(contains(entities.get(0))));
}
Aggregations