iOutput.append(OStringSerializerHelper.RECORD_SEPARATOR);
if (o == null)
continue;
OIdentifiable id = null;
ODocument doc = null;
final OClass linkedClass;
if (!(o instanceof OIdentifiable)) {
final String fieldBound = OObjectSerializerHelper.getDocumentBoundField(o.getClass());
if (fieldBound != null) {
OObjectSerializerHelper.invokeCallback(o, null, OBeforeSerialization.class);
doc = (ODocument) OObjectSerializerHelper.getFieldValue(o, fieldBound);
OObjectSerializerHelper.invokeCallback(o, doc, OAfterSerialization.class);
id = doc;
}
linkedClass = iLinkedClass;
} else {
id = (OIdentifiable) o;
if (iLinkedType == null)
// AUTO-DETERMINE LINKED TYPE
if (id.getIdentity().isValid())
iLinkedType = OType.LINK;
else
iLinkedType = OType.EMBEDDED;
if (id instanceof ODocument) {
doc = (ODocument) id;
if (id.getIdentity().isTemporary())
doc.save();
linkedClass = doc.getSchemaClass();
} else
linkedClass = null;