From: Reino Ruusu Date: Tue, 20 Aug 2019 08:07:04 +0000 (+0300) Subject: Fix binding instance for CompoundRelatedGetValue method. X-Git-Tag: v1.43.0~136^2~111^2 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=9dd09d3887ea1189555864f6ca197b695fb28e78;p=simantics%2Fplatform.git Fix binding instance for CompoundRelatedGetValue method. gitlab #344 Change-Id: I899d10258c429e215c7c02f717e34631925ebc01 --- diff --git a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java index 90900cbfa..b98961154 100644 --- a/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java +++ b/bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java @@ -14,13 +14,12 @@ package org.simantics.objmap.graph.annotations.factories; import java.lang.annotation.Annotation; import java.lang.reflect.Method; -import org.simantics.databoard.Bindings; import org.simantics.databoard.binding.Binding; -import org.simantics.databoard.binding.error.BindingConstructionException; -import org.simantics.databoard.binding.reflection.BindingRequest; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.request.PropertyInfo; +import org.simantics.db.layer0.request.PropertyInfoRequest; import org.simantics.objmap.bidirectional.IBidirectionalMappingRule; import org.simantics.objmap.graph.annotations.CompoundRelatedGetValue; import org.simantics.objmap.graph.annotations.CompoundRelatedSetValue; @@ -46,12 +45,8 @@ public class CompoundRelatedGetSetValueRuleFactory implements IGetSetRule // Class adapterClass = getterAnn.adapter(); IRangeAccessor rangeAccessor = new CompoundGetSetValueAccessor(getter, setter); - Binding valueBinding = null; - try { - valueBinding = Bindings.getBinding(BindingRequest.create(getter)); - } catch (BindingConstructionException e) { - } - + PropertyInfo propInfo = g.syncRequest(new PropertyInfoRequest(g.getResource(getterAnn.valRelation()))); + Binding valueBinding = propInfo.defaultBinding; // Resource valueType; // if (adapterClass == IdentityAdapter.class) { // valueType = dataTypeOfClass(g, getter.getReturnType());