1 package fi.vtt.simantics.procore.internal;
3 import java.util.HashSet;
6 import org.simantics.db.impl.query.CacheEntry;
7 import org.simantics.db.impl.query.CacheEntryBase;
8 import org.simantics.db.impl.service.QueryDebug;
9 import org.simantics.db.request.AsyncMultiRead;
10 import org.simantics.db.request.AsyncRead;
11 import org.simantics.db.request.MultiRead;
12 import org.simantics.db.request.Read;
14 public class QueryDebugImpl implements QueryDebug {
16 final private SessionImplSocket session;
18 QueryDebugImpl(SessionImplSocket session) {
19 this.session = session;
23 public Set<CacheEntry> getParents(AsyncRead<?> request) {
24 HashSet<CacheEntry> result = new HashSet<CacheEntry>();
25 CacheEntryBase entry = session.queryProvider2.asyncReadMap.get(request);
27 for(CacheEntry parent : entry.getParents(session.queryProvider2)) result.add(parent);
33 public Set<CacheEntry> getParents(AsyncMultiRead<?> request) {
34 HashSet<CacheEntry> result = new HashSet<CacheEntry>();
35 CacheEntryBase entry = session.queryProvider2.asyncMultiReadMap.get(request);
37 for(CacheEntry parent : entry.getParents(session.queryProvider2)) result.add(parent);
43 public Set<CacheEntry> getParents(Read<?> request) {
44 HashSet<CacheEntry> result = new HashSet<CacheEntry>();
45 CacheEntryBase entry = session.queryProvider2.readMap.get(request);
47 for(CacheEntry parent : entry.getParents(session.queryProvider2)) result.add(parent);
53 public Set<CacheEntry> getParents(MultiRead<?> request) {
54 HashSet<CacheEntry> result = new HashSet<CacheEntry>();
55 CacheEntryBase entry = session.queryProvider2.multiReadMap.get(request);
57 for(CacheEntry parent : entry.getParents(session.queryProvider2)) result.add(parent);