if (iGraph.isAutoScaleEdgeType()
&& (prop == null || propType == OType.LINK || "true".equalsIgnoreCase(prop.getCustom("ordered")))) {
// CREATE ONLY ONE LINK
out = iTo;
} else if (propType == OType.LINKLIST || (prop != null && "true".equalsIgnoreCase(prop.getCustom("ordered")))) {
final Collection coll = new ORecordLazyList(iFromVertex);
coll.add(iTo);
out = coll;
} else if (propType == null || propType == OType.LINKBAG) {
final ORidBag bag = new ORidBag();
bag.add(iTo);
out = bag;
} else
throw new IllegalStateException("Type of field provided in schema '" + prop.getType()
+ " can not be used for link creation.");
} else if (found instanceof OIdentifiable) {
if (prop != null && propType == OType.LINK)
throw new IllegalStateException("Type of field provided in schema '" + prop.getType()
+ " can not be used for creation to hold several links.");
if (prop != null && "true".equalsIgnoreCase(prop.getCustom("ordered"))) {
final Collection coll = new ORecordLazyList(iFromVertex);
coll.add(found);
coll.add(iTo);
out = coll;
} else {
final ORidBag bag = new ORidBag();
bag.add((OIdentifiable) found);
bag.add(iTo);