Skip to content

Commit

Permalink
Fixed issue #5051 and #3534
Browse files Browse the repository at this point in the history
Found the problem: on edge removal the setting
graph.isAutoScaleEdgeType() is not considered, and a collection is
transformed on single value.
  • Loading branch information
lvca committed Oct 4, 2015
1 parent 934c6d2 commit fae450f
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -594,10 +594,14 @@ protected boolean dropEdgeFromVertex(final OIdentifiable iEdge, final ODocument
return false;
}

if (coll.size() == 1)
iVertex.field(iFieldName, coll.iterator().next());
else if (coll.size() == 0)
iVertex.removeField(iFieldName);
if (getGraph().isAutoScaleEdgeType()) {
// SCALE DOWN THE TYPE (SAVES SPACE BUT COULD CAUSE VALIDATION ERRORS)
if (coll.size() == 1)
iVertex.field(iFieldName, coll.iterator().next());
else if (coll.size() == 0)
iVertex.removeField(iFieldName);
}

} else
throw new IllegalStateException("Wrong type found in the field '" + iFieldName + "': " + iFieldValue.getClass());

Expand Down

0 comments on commit fae450f

Please sign in to comment.