X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FQueryProcessor.java;fp=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FQueryProcessor.java;h=5a37257e2531c051c39de0bea04af271e1adccce;hp=b2951cb27e3c122322aeca97aabe124cac8b9702;hb=ddd1f416671666c81fe5c5766c9f1b0b133b1c5c;hpb=e8514874e3bfee95b0b42799b4ec8962616793f7 diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryProcessor.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryProcessor.java index b2951cb27..5a37257e2 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryProcessor.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/QueryProcessor.java @@ -2296,67 +2296,16 @@ final public class QueryProcessor extends AbstractDisposable implements ReadGrap @Override final public void forEachPredicate(final ReadGraphImpl impl, final Resource subject, final AsyncMultiProcedure procedure) { - throw new UnsupportedOperationException(); + try { -// assert(subject != null); -// assert(procedure != null); -// -// final ListenerBase listener = getListenerBase(procedure); -// -// IntProcedure ip = new IntProcedure() { -// -// AtomicBoolean first = new AtomicBoolean(true); -// -// @Override -// public void execute(ReadGraphImpl graph, int i) { -// try { -// if(first.get()) { -// procedure.execute(graph, querySupport.getResource(i)); -// } else { -// procedure.execute(impl.newRestart(graph), querySupport.getResource(i)); -// } -// } catch (Throwable t2) { -// Logger.defaultLogError(t2); -// } -// } -// -// @Override -// public void finished(ReadGraphImpl graph) { -// try { -// if(first.compareAndSet(true, false)) { -// procedure.finished(graph); -//// impl.state.barrier.dec(this); -// } else { -// procedure.finished(impl.newRestart(graph)); -// } -// -// } catch (Throwable t2) { -// Logger.defaultLogError(t2); -// } -// } -// -// @Override -// public void exception(ReadGraphImpl graph, Throwable t) { -// try { -// if(first.compareAndSet(true, false)) { -// procedure.exception(graph, t); -// } else { -// procedure.exception(impl.newRestart(graph), t); -// } -// } catch (Throwable t2) { -// Logger.defaultLogError(t2); -// } -// } -// -// }; -// -// int sId = querySupport.getId(subject); -// -// try { -// QueryCache.runnerPredicates(impl, sId, impl.parent, listener, ip); -// } catch (DatabaseException e) { -// Logger.defaultLogError(e); -// } + for(Resource predicate : getPredicates(impl, subject)) + procedure.execute(impl, predicate); + + procedure.finished(impl); + + } catch (Throwable e) { + procedure.exception(impl, e); + } }