X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2FQueryIndexUtils.java;h=ed6886abecec8aab22a9dd9e6c0e0d1226b0d64c;hp=4a066a30c06b817cf186e93eeb2701567d8d6fc7;hb=3c524553c98b56075d854f355bc7bab2e3ae17f7;hpb=8c8283a01e63980527d605936286747006bea601 diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/QueryIndexUtils.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/QueryIndexUtils.java index 4a066a30c..ed6886abe 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/QueryIndexUtils.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/QueryIndexUtils.java @@ -12,6 +12,7 @@ import org.simantics.db.common.utils.NameUtils; import org.simantics.db.exception.DatabaseException; import org.simantics.db.layer0.adapter.Instances; import org.simantics.db.layer0.adapter.impl.EntityInstances.QueryIndex; +import org.simantics.db.layer0.genericrelation.IndexQueries; import org.simantics.db.layer0.util.Layer0Utils; import org.simantics.layer0.Layer0; import org.simantics.scl.runtime.function.Function1; @@ -33,7 +34,7 @@ public final class QueryIndexUtils { } public static List searchByGUID(ReadGraph graph, Resource indexRoot, String indexString) throws DatabaseException { - return searchByQueryShallow(graph, indexRoot, "GUID:" + indexString); + return searchByQueryShallow(graph, indexRoot, "GUID:" + IndexQueries.quoteTerm(indexString)); } public static List searchByQueryShallow(ReadGraph graph, Resource model, String query) throws DatabaseException { @@ -90,6 +91,6 @@ public final class QueryIndexUtils { } public static List searchByTypeAndNameShallow(ReadGraph graph, Resource model, Resource type, String name) throws DatabaseException { - return graph.syncRequest(new QueryIndex(model, type, name), TransientCacheListener.>instance()); + return graph.syncRequest(new QueryIndex(model, type, IndexQueries.quoteTerm(name)), TransientCacheListener.>instance()); } }