X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FModelingUtils.java;h=2afdac9927aea060858b0b30f3a30c3d59ddaf87;hp=511eeb3fa0e41fb0894b866d293cc330812c3923;hb=4b5b16eec880434af849ddd6522332884bfb5538;hpb=59e011d8d6e88ddebb7300cb60109c6bd43f5de8 diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/ModelingUtils.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/ModelingUtils.java index 511eeb3fa..2afdac992 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/ModelingUtils.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/ModelingUtils.java @@ -91,6 +91,7 @@ import org.simantics.db.layer0.adapter.CopyHandler; import org.simantics.db.layer0.adapter.GenericRelationIndex; import org.simantics.db.layer0.adapter.Instances; import org.simantics.db.layer0.adapter.impl.DefaultPasteImportAdvisor; +import org.simantics.db.layer0.adapter.impl.EntityInstances.QueryIndex; import org.simantics.db.layer0.adapter.impl.ImportAdvisorFactory; import org.simantics.db.layer0.genericrelation.IndexedRelations; import org.simantics.db.layer0.migration.MigrationUtils; @@ -704,7 +705,7 @@ public class ModelingUtils { } public static List searchByTypeShallow(ReadGraph graph, Resource model, Resource type) throws DatabaseException { - return filterByIndexRoot(graph, model, searchByType(graph, model, type)); + return graph.syncRequest(new QueryIndex(model, type, ""), TransientCacheListener.>instance()); } public static List searchByType(ReadGraph graph, Resource model, Resource type) throws DatabaseException { @@ -721,7 +722,7 @@ public class ModelingUtils { } public static List searchByQueryShallow(ReadGraph graph, Resource model, String query) throws DatabaseException { - return filterByIndexRoot(graph, model, searchByQuery(graph, model, query)); + return graph.syncRequest(new QueryIndex(model, Layer0.getInstance(graph).Entity, query), TransientCacheListener.>instance()); } public static List searchByQuery(ReadGraph graph, Resource model, String query) throws DatabaseException { @@ -774,7 +775,7 @@ public class ModelingUtils { } public static List searchByTypeAndNameShallow(ReadGraph graph, Resource model, Resource type, String name) throws DatabaseException { - return filterByIndexRoot(graph, model, searchByTypeAndName(graph, model, type, name)); + return graph.syncRequest(new QueryIndex(model, type, name), TransientCacheListener.>instance()); } /**