X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.db.impl%2Fsrc%2Forg%2Fsimantics%2Fdb%2Fimpl%2Fquery%2FCodeGen.java;h=3d5f14ac493603d800102438e65ff5751786e8ec;hb=de8b6e194da6d56c410101d9c72763078b0e8717;hp=cd540eaadbf59a63c3e450999254ead404a9cefe;hpb=1f8b50d81a1aa1bbd67a77f7cbc1060f2eb805d4;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CodeGen.java b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CodeGen.java index cd540eaad..3d5f14ac4 100644 --- a/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CodeGen.java +++ b/bundles/org.simantics.db.impl/src/org/simantics/db/impl/query/CodeGen.java @@ -14,8 +14,6 @@ public class CodeGen { int indent = 4; - - String[] signatureR1RelationInfo = { "int r", "r", "keyR", "long", "InternalProcedure", "entry.id" }; String[] signatureR1Bytes = { "int r", "r", "keyR", "long", "InternalProcedure", "entry.id" }; String[] signatureR1IntSet = { "int r", "r", "keyR", "long", "InternalProcedure", "entry.id" }; @@ -54,7 +52,7 @@ public class CodeGen { line(content, " return;"); line(content, " }"); } - line(content, " " + clazz + " entry = (" + clazz + ")cache.getOrCreate" + clazz + "(graph, " + signature[1] + (genAsync ? ", isSync" : "") + ");"); + line(content, " " + clazz + " entry = (" + clazz + ")cache.getOrCreate" + clazz + "(graph.processor, " + signature[1] + (genAsync ? ", isSync" : "") + ");"); if(genAsync) { line(content, " if(entry == null) {"); line(content, " graph.processor.schedule(new SessionTask(false) {"); @@ -102,7 +100,7 @@ public class CodeGen { String lower = Character.toLowerCase(clazz.charAt(0)) + clazz.substring(1); - line(content, "" + clazz + " getOrCreate" + clazz + "(ReadGraphImpl graph, " + signature[0] + (genAsync ? ", boolean isSync" : "") + ") throws DatabaseException {"); + line(content, "" + clazz + " getOrCreate" + clazz + "(QueryProcessor processor, " + signature[0] + (genAsync ? ", boolean isSync" : "") + ") throws DatabaseException {"); line(content, " " + clazz + " existing = null;"); line(content, " synchronized(" + lower + "Map) {"); line(content, " existing = (" + clazz + ")" + lower + "Map.get(" + signature[1] + ");"); @@ -121,11 +119,11 @@ public class CodeGen { line(content, " }"); if(genAsync) { line(content, " if(existing.isPending()) {"); - line(content, " if(isSync) waitPending(graph, existing);"); + line(content, " if(isSync) waitPending(processor, existing);"); line(content, " else return null;"); line(content, " }"); } else { - line(content, " if(existing.isPending()) waitPending(graph, existing);"); + line(content, " if(existing.isPending()) waitPending(processor, existing);"); } line(content, " return existing;"); line(content, "}"); @@ -188,15 +186,14 @@ public class CodeGen { generateQuery(content, "ReadEntry", signatureRead, true, true); generateQuery(content, "AsyncReadEntry", signatureAsyncRead, true, true); generateQuery(content, "Types", signatureR1IntSet, true, false); - //generateQuery(content, "NamespaceIndex", signatureID2, true); generateQuery(content, "ChildMap", signatureChildMap, true, false); + generateQuery(content, "TypeHierarchy", signatureR1IntSet, true, false); + generateQuery(content, "SuperTypes", signatureR1IntSet, true, false); + generateQuery(content, "SuperRelations", signatureR1IntSet, true, false); - generateQuery(content, "AssertedStatements", signatureR2TIP, false, false); generateQuery(content, "AssertedPredicates", signatureR1IP, false, false); + generateQuery(content, "AssertedStatements", signatureR2TIP, false, false); generateQuery(content, "DirectSuperRelations", signatureR1IP, false, false); - generateQuery(content, "SuperTypes", signatureR1IntSet, false, false); - generateQuery(content, "TypeHierarchy", signatureR1IntSet, false, false); - generateQuery(content, "SuperRelations", signatureR1IntSet, false, false); generateQuery(content, "MultiReadEntry", signatureMultiRead, false, false); generateQuery(content, "AsyncMultiReadEntry", signatureAsyncMultiRead, false, false); generateQuery(content, "ExternalReadEntry", signatureExternalRead, false, false);