1 package org.simantics.db.impl;
3 import org.simantics.db.ReadGraph;
4 import org.simantics.db.RelationInfo;
5 import org.simantics.db.Resource;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.db.impl.query.QueryProcessor;
8 import org.simantics.db.procedure.SyncMultiProcedure;
10 public final class ForEachObjectProcedure implements SyncMultiProcedure<Resource> {
12 public final int predicateKey;
13 public final int[] clusterKey;
14 public final int[] predicateReference;
15 public final RelationInfo info;
16 public final QueryProcessor processor;
17 public final ClusterI.CompleteTypeEnum completeType;
18 private final SyncMultiProcedure<Resource> user;
20 public ForEachObjectProcedure(int predicateKey, RelationInfo info, QueryProcessor processor, SyncMultiProcedure<Resource> user) {
21 this.predicateKey = predicateKey;
22 this.completeType = ClusterTraitsBase.getCompleteTypeFromResourceKey(predicateKey);
25 this.processor = processor;
26 this.clusterKey = new int[32*8];
27 this.predicateReference = new int[32*8];
31 public void execute(ReadGraph graph, Resource result) throws DatabaseException {
32 user.execute(graph, result);
36 public void finished(ReadGraph graph) throws DatabaseException {
41 public void exception(ReadGraph graph, Throwable throwable) throws DatabaseException {
42 user.exception(graph, throwable);