use of org.openntf.xsp.nosql.communication.driver.DQL.DQLTerm in project org.openntf.xsp.jakartaee by OpenNTF.
the class DefaultDominoDocumentCollectionManager method delete.
@Override
public void delete(DocumentDeleteQuery query) {
try {
Database database = supplier.get();
List<String> unids = query.getDocuments();
if (unids != null && !unids.isEmpty()) {
for (String unid : unids) {
if (unid != null && !unid.isEmpty()) {
lotus.domino.Document doc = database.getDocumentByUNID(unid);
doc.remove(true);
}
}
} else if (query.getCondition().isPresent()) {
// Then do it via DQL
DQLTerm dql = QueryConverter.getCondition(query.getCondition().get());
DominoQuery dominoQuery = database.createDominoQuery();
DocumentCollection docs = dominoQuery.execute(dql.toString());
docs.removeAll(true);
}
} catch (NotesException e) {
throw new RuntimeException(e);
}
}
use of org.openntf.xsp.nosql.communication.driver.DQL.DQLTerm in project org.openntf.xsp.jakartaee by OpenNTF.
the class DefaultDominoDocumentCollectionManager method count.
@Override
public long count(String documentCollection) {
try {
Database database = supplier.get();
DominoQuery dominoQuery = database.createDominoQuery();
DQLTerm dql = DQL.item(EntityConverter.NAME_FIELD).isEqualTo(documentCollection);
DocumentCollection result = dominoQuery.execute(dql.toString());
return result.getCount();
} catch (NotesException e) {
throw new RuntimeException(e);
}
}
Aggregations