]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/util/Layer0Utils.java
DB and Layer0 modifications for related issues
[simantics/platform.git] / bundles / org.simantics.db.layer0 / src / org / simantics / db / layer0 / util / Layer0Utils.java
index 62c7093da11e999d7e22b60a17ccb1221088fe18..610c8c8bd42d8735868cf1f80e4603ae5e63b7d8 100644 (file)
@@ -74,6 +74,7 @@ import org.simantics.db.common.request.ObjectsWithType;
 import org.simantics.db.common.request.PossibleChild;
 import org.simantics.db.common.request.PossibleIndexRoot;
 import org.simantics.db.common.request.WriteRequest;
+import org.simantics.db.common.utils.CommonDBUtils;
 import org.simantics.db.common.utils.NameUtils;
 import org.simantics.db.event.ChangeListener;
 import org.simantics.db.exception.CancelTransactionException;
@@ -353,13 +354,9 @@ public class Layer0Utils {
                throw new IllegalArgumentException("Unable to convert datatype into SCL type: " + type);
        }
 
-
+       @Deprecated
        public static Type getSCLType(ReadGraph graph, RuntimeEnvironment runtimeEnvironment, String typeText) throws DatabaseException {
-        try {
-                       return Environments.getType(runtimeEnvironment.getEnvironment(), typeText);
-               } catch (SCLExpressionCompilationException e) {
-                       throw new DatabaseException(e);
-               }
+           return CommonDBUtils.getSCLType(graph, runtimeEnvironment, typeText);
        }
 
        public static Type getSCLType(ReadGraph graph, Variable property) throws DatabaseException {
@@ -646,15 +643,14 @@ public class Layer0Utils {
                return graph.getPossibleResource(graph.getURI(root) + suffix);
        }
 
+       @Deprecated
        public static Resource getPossibleChild(ReadGraph graph, Resource resource, String name) throws DatabaseException {
-               return graph.sync(new PossibleChild(resource, name));
+               return CommonDBUtils.getPossibleChild(graph, resource, name);
        }
 
+       @Deprecated
        public static Resource getPossibleChild(ReadGraph graph, Resource resource, Resource type, String name) throws DatabaseException {
-               Resource child = graph.sync(new PossibleChild(resource, name));
-               if(child == null) return null;
-               if(!graph.isInstanceOf(child, type)) return null;
-               return child;
+               return CommonDBUtils.getPossibleChild(graph, resource, type, name);
        }
 
        public static RelationContext relationContext(ReadGraph graph, Resource subject, Resource predicate) throws DatabaseException {