]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Fixed some issues in objmap2 09/3109/1
authorReino Ruusu <reino.ruusu@semantum.fi>
Thu, 15 Aug 2019 12:40:16 +0000 (15:40 +0300)
committerReino Ruusu <reino.ruusu@semantum.fi>
Thu, 15 Aug 2019 12:40:16 +0000 (15:40 +0300)
gitlab #346

Change-Id: I37ca3edb171f5c88f9deac5f03ff29ecf8c28518

bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/annotations/UpdateMethod.java
bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/impl/Mapping.java
bundles/org.simantics.objmap2/src/org/simantics/objmap/graph/schema/SimpleLinkType.java

index 1e2ff4f2d8c753c5fa11e1291705d376b7395611..d26b565b9c39d1f0a2246dc86797a7472663e784 100644 (file)
@@ -16,7 +16,7 @@ import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
-import org.simantics.objmap.graph.annotations.meta.IsFieldRule;
+import org.simantics.objmap.graph.annotations.meta.IsMethodRule;
 
 
 
@@ -27,6 +27,6 @@ import org.simantics.objmap.graph.annotations.meta.IsFieldRule;
  */
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
-@IsFieldRule
+@IsMethodRule
 public @interface UpdateMethod {
 }
index 9f048f7752b1a900a1730eae5242d53519d21a8b..1c44ef9304aee20141386a0271c0bbc36aa85cf1 100644 (file)
@@ -280,9 +280,10 @@ public class Mapping<Domain, Range> implements IMapping<Domain, Range> {
                        if(link.type == null) {
                                createDomain(g, link);
                        }
-                       
-                       if(link.type.updateDomain(g, map, link.domainElement, link.rangeElement))
-                               updated.add(link.domainElement);
+                       else {
+                               if(link.type.updateDomain(g, map, link.domainElement, link.rangeElement))
+                                       updated.add(link.domainElement);
+                       }
                }       
                if (listensDomain)
                        updateRange(g); //FIXME: without this listening would stop. 
index 1de0e31fab355321e8fd84f06d6822dc17778216..096d07cb83d609b0d33ccc49090ba49d649f32fb 100644 (file)
@@ -127,7 +127,7 @@ public class SimpleLinkType<Range> implements ILinkType<Resource,Range> {
             try { 
                 LOGGER.info("SimpleLinkType.updateRange " +
                                NameUtils.getSafeName(g, domainElement) + " " +
-                        rangeElement.toString()
+                        (rangeElement.getClass().getName() + "@" + Integer.toHexString(rangeElement.hashCode()))
                         );
             } catch(DatabaseException e) {
                 throw new MappingException(e);