本文整理了Java中com.psddev.dari.db.Query.iterable
方法的一些代码示例,展示了Query.iterable
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.iterable
方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:iterable
[英]Returns an iterable of all objects matching this query in a #getDatabase.
[中]返回#getDatabase中与此查询匹配的所有对象的iterable。
代码示例来源:origin: perfectsense/brightspot-cms
public DirectoryQueryIterator(Query<Directory> directoryQuery) {
this.directoryIterator = directoryQuery.iterable(0).iterator();
}
代码示例来源:origin: perfectsense/dari
/**
* Creates a new instance that runs in the given {@code executor},
* and produces items that match the given {@code query} from the
* given {@code database} into the given {@code output} queue.
*
* @param executor If {@code null}, uses the default executor.
* @param output If {@code null}, creates a new queue.
* @param database Can't be {@code null}.
* @param query Can't be {@code null}.
* @throws IllegalArgumentException If the given {@code database}
* or {@code query} is {@code null}.
*/
public AsyncDatabaseReader(
String executor,
AsyncQueue<E> output,
Database database,
Query<E> query) {
super(executor, output);
if (database == null) {
throw new IllegalArgumentException("Database can't be null!");
}
if (query == null) {
throw new IllegalArgumentException("Query can't be null!");
}
this.iterator = query.using(database).iterable(0).iterator();
}
代码示例来源:origin: perfectsense/brightspot-cms
@Override
public Iterable<? extends ToolUser> getUsers() {
return Query.from(ToolUser.class).where("role = ?", this).iterable(0);
}
代码示例来源:origin: perfectsense/dari
Iterator<E> iterator = iterable(0).iterator();
List<E> items = new ArrayList<E>();
代码示例来源:origin: perfectsense/brightspot-cms
.noCache()
.resolveInvisible()
.iterable(0)) {
代码示例来源:origin: perfectsense/brightspot-cms
private void writeCsvResponse(Context page) throws IOException {
HttpServletResponse response = page.getResponse();
response.setContentType("text/csv");
response.setHeader("Content-Disposition", "attachment; filename=search-result-" + new DateTime(null, page.getUserDateTimeZone()).toString("yyyy-MM-dd-hh-mm-ss") + ".csv");
page.writeHeaderRow();
Query searchQuery = page.getSearch().toQuery(page.getSite());
if (page.getSelection() != null) {
searchQuery.where(page.getSelection().createItemsQuery().getPredicate());
}
addLegacyDatabaseSupport(searchQuery);
int count = 0;
for (Object item : searchQuery.iterable(0)) {
page.writeDataRow(item);
count++;
if (count % 10000 == 0) {
try {
Thread.sleep(THROTTLE_INTERVAL);
} catch (InterruptedException e) {
LOGGER.error(e.getMessage(), e);
}
}
}
}
代码示例来源:origin: perfectsense/brightspot-cms
Map<String, ContentEditBulkSubmissionError> errors = getErrors();
for (Iterator<?> i = getQuery().iterable(0).iterator(); shouldContinue() && i.hasNext();) {
Object item = i.next();
State itemState = State.getInstance(item);
代码示例来源:origin: perfectsense/brightspot-cms
from(ToolUser.class).
where("notifications = ?", this).
iterable(0)) {
try {
for (NotificationMethod method : receiver.getNotifyVia()) {
代码示例来源:origin: perfectsense/dari
if (deleteFirst) {
LOGGER.info("Deleting all records in database to load " + filename);
for (Object obj : Query.fromAll().where("_type != ?", localObjTypeId).and("_id != ?", globalsId).noCache().using(database).resolveToReferenceOnly().iterable(100)) {
if (!shouldContinue()) {
break;
for (Object obj : Query.fromAll().where("_type = ?", typeIds).and("_type != ?", localObjTypeId).and("_id != ?", globalsId).noCache().using(database).resolveToReferenceOnly().iterable(100)) {
if (!shouldContinue()) {
break;
代码示例来源:origin: perfectsense/dari
for (Object r : Query.fromType(objType).using(database).noCache().resolveToReferenceOnly().iterable(100)) {
writer.write(ObjectUtils.toJson(((Recordable) r).getState().getSimpleValues(true)));
writer.write('\n');
for (Object r : Query.fromType(typeMapType).using(database).noCache().resolveToReferenceOnly().iterable(100)) {
writer.write(ObjectUtils.toJson(((Recordable) r).getState().getSimpleValues(true)));
writer.write('\n');
concreteQuery.where("_type = ?", typeId);
for (Object o : concreteQuery.noCache().resolveToReferenceOnly().iterable(100)) {
if (o instanceof Recordable) {
Recordable r = (Recordable) o;
代码示例来源:origin: perfectsense/dari
iterator = query.iterable(QUERY_ITERABLE_SIZE).iterator();
代码示例来源:origin: perfectsense/brightspot-cms
.where("triggerDate >= ? and triggerDate < ?", begin, end)
.sortAscending("triggerDate")
.iterable(0)) {
代码示例来源:origin: perfectsense/brightspot-cms
.and("com.psddev.cms.db.Draft/objectId = ?", object)
.resolveInvisible()
.iterable(0)) {
if (!(dObject instanceof Draft)) {
continue;
代码示例来源:origin: perfectsense/brightspot-cms
Iterator queryIterator = page.itemsQuery().noCache().iterable(0).iterator();
代码示例来源:origin: perfectsense/brightspot-cms
.where("triggerDate >= ? and triggerDate < ?", begin, end)
.sortAscending("triggerDate")
.iterable(0)) {
代码示例来源:origin: perfectsense/brightspot-cms
for (Workflow w : workflowQuery.iterable(0)) {
for (WorkflowState s : w.getStates()) {
workflowStateLabels.put("ws." + s.getName(), s.getDisplayName());
代码示例来源:origin: perfectsense/brightspot-cms
for (Object item : query.noCache().iterable(0)) {
State itemState = State.getInstance(item);
Iterator<Object> queryIterator = query.noCache().iterable(0).iterator();
代码示例来源:origin: perfectsense/dari
long matched = 0;
for (Object item : query.iterable(0)) {
++ total;
if (total % 1000 == 0) {
内容来源于网络,如有侵权,请联系作者删除!