X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.db.layer0%2Fsrc%2Forg%2Fsimantics%2Fdb%2Flayer0%2Fvariable%2FStandardGraphChildVariable.java;h=78fff71c2d44a31696332c96d1c90097aa6a7078;hb=659b89ec3b47e57753db44217990499ebf0b2486;hp=af8f75c494dd242534373523bbdfb45d0b6f664f;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java index af8f75c49..78fff71c2 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java @@ -12,8 +12,8 @@ import org.simantics.db.Resource; import org.simantics.db.common.procedure.adapter.TransientCacheAsyncListener; import org.simantics.db.exception.AssumptionException; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.exception.VariableException; import org.simantics.db.layer0.exception.InvalidVariableException; -import org.simantics.db.layer0.exception.VariableException; import org.simantics.db.layer0.function.All; import org.simantics.db.layer0.request.ClassificationsRequest; import org.simantics.db.layer0.request.VariableURI; @@ -150,7 +150,7 @@ public class StandardGraphChildVariable extends AbstractChildVariable { @Override final public Resource getRepresents(ReadGraph graph) throws DatabaseException { if(resource == null) - throw new VariableException("Variable is not represented by any resource (URI=" + getPossibleURI(graph) + ")."); + throw new InvalidVariableException("Variable is not represented by any resource (URI=" + getPossibleURI(graph) + ")."); return resource; // Layer0X L0X = Layer0X.getInstance(graph); // Resource represents = graph.getPossibleObject(resource, L0X.Represents); @@ -255,14 +255,18 @@ public class StandardGraphChildVariable extends AbstractChildVariable { return getClass().getSimpleName() + "[" + resource + "]"; } - protected VariableMap getPossiblePropertyVariableMap(ReadGraph graph) throws DatabaseException { + protected VariableMap getPossiblePropertyVariableMap(ReadGraph graph) throws DatabaseException { if(resource == null) return All.standardChildDomainProperties; - return graph.getPossibleRelatedValue2(resource, Layer0.getInstance(graph).domainProperties, this); - } + Resource domainProperties = Layer0.getInstance(graph).domainProperties; + return graph.getPossibleRelatedValue2(resource, domainProperties, + new StandardGraphPropertyVariable(graph, this, domainProperties)); + } protected VariableMap getPossibleChildVariableMap(ReadGraph graph) throws DatabaseException { if(resource == null) return All.standardChildDomainChildren; - return graph.getPossibleRelatedValue2(resource, Layer0.getInstance(graph).domainChildren, this); + Resource domainChildren = Layer0.getInstance(graph).domainChildren; + return graph.getPossibleRelatedValue2(resource, domainChildren, + new StandardGraphPropertyVariable(graph, this, domainChildren)); } @Override