import org.simantics.databoard.util.binary.RandomAccessBinary;
import org.simantics.db.AsyncReadGraph;
import org.simantics.db.DevelopmentKeys;
+import org.simantics.db.ExternalValue;
import org.simantics.db.ExternalValueSupport;
import org.simantics.db.ReadGraph;
import org.simantics.db.RelationContext;
for(Resource converter : graph.getObjects(resource, L0.ConvertsToValueWith)) {
try {
if(L0.Functions_functionApplication.equals(converter)) {
- return (Function3<ReadGraph,Resource,Object,T>)graph.syncRequest(new AdaptValue(resource));
+ return AdaptValue.functionApplication;
+ //return (Function3<ReadGraph,Resource,Object,T>)graph.syncRequest(new AdaptValue(resource));
} else {
return graph.getValue2(converter, resource);
}
}
} else if(types.contains(L0.ExternalValue)) {
try {
- return (T)ReflectionUtils.getValue(getURI(r)).getValue();
- } catch(ValueNotFoundException e) {
- throw new DatabaseException(e);
+ ExternalValue ev = adapt(r, ExternalValue.class);
+ return ev.getValue(this, r);
+ //return (T)ReflectionUtils.getValue(getURI(r)).getValue();
+// } catch(ValueNotFoundException e) {
+// throw new DatabaseException(e);
} catch(ClassCastException e) {
throw new DatabaseException(e);
}