我有以下Java代码片段:
import org.ojai.Document;
public class JsonRepository {
public Object jsonStore; // what type should be this Object
public Document createDocument()
{
....
}
}
import org.ojai.Document;
import org.ojai.DocumentStream;
import org.ojai.store.QueryCondition;
@Repository
public class accountRepository extends JsonRepository {
public DocumentStream accountsAsStream(List<String> ids) {
QueryCondition condition = jsonStore.getQueryCondition().in(123, ids);
......
List<Document> documents = jsonStore.query(condition);
.......
return jsonStore.queryAsStream(condition);
}
public DocumentStream accountIdsAsStream() {
return jsonStore.getAllDocumentsAsStream("id");
}
}
字符串
我找不到什么类型的变量应该是jsonStore
。它需要支持这些方法:queryAsStream
、query
、queryAsStream
、getAllDocumentsAsStream
等你知道怎么找到这个吗?
1条答案
按热度按时间hwazgwia1#
这段代码看起来有点过时。
有没有可能您不想使用
queryAsStream
方法,而宁愿使用DocumentStore.find()
?返回
QueryResult
,它是DocumentStream
的子类。如果这是有意义的,那么
jsonStore
的类型应该是DocumentStore
。参见https://www.ojai.io/javadocs/latest/