]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/factories/CompoundRelatedGetSetValueRuleFactory.java
Fix binding instance for CompoundRelatedGetValue method.
[simantics/platform.git] / bundles / org.simantics.objmap2 / src / org / simantics / objmap / graph / annotations / factories / CompoundRelatedGetSetValueRuleFactory.java
index 90900cbfa0763fdb7be4a58097524d559a4751f1..b98961154ca4cddec50b5a2ddd8efbcc62a1f17a 100644 (file)
@@ -14,13 +14,12 @@ package org.simantics.objmap.graph.annotations.factories;
 import java.lang.annotation.Annotation;
 import java.lang.reflect.Method;
 
 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.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.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;
 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<Range> implements IGetSetRule
                
 //             Class<? extends ValueAdapter> adapterClass = getterAnn.adapter();
                IRangeAccessor<Range,Object> rangeAccessor = new CompoundGetSetValueAccessor<Range,Object>(getter, setter);
                
 //             Class<? extends ValueAdapter> adapterClass = getterAnn.adapter();
                IRangeAccessor<Range,Object> rangeAccessor = new CompoundGetSetValueAccessor<Range,Object>(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());
 //        Resource valueType;
 //        if (adapterClass == IdentityAdapter.class) {
 //            valueType = dataTypeOfClass(g, getter.getReturnType());