public static boolean hasSameContentItem(final Object iCurrent, ODatabaseDocumentInternal iMyDb, final Object iOther,
final ODatabaseDocumentInternal iOtherDb, RIDMapper ridMapper) {
if (iCurrent instanceof ODocument) {
final ODocument current = (ODocument) iCurrent;
if (iOther instanceof ORID) {
if (!current.isDirty()) {
ORID id;
if (ridMapper != null) {
ORID mappedId = ridMapper.map(current.getIdentity());
if (mappedId != null)
id = mappedId;
else
id = current.getIdentity();
} else
id = current.getIdentity();
if (!id.equals(iOther)) {
return false;
}
} else {
final ODocument otherDoc = iOtherDb.load((ORID) iOther);
if (!ODocumentHelper.hasSameContentOf(current, iMyDb, otherDoc, iOtherDb, ridMapper))
return false;
}
} else if (!ODocumentHelper.hasSameContentOf(current, iMyDb, (ODocument) iOther, iOtherDb, ridMapper))
return false;
} else if (!compareScalarValues(iCurrent, iMyDb, iOther, iOtherDb, ridMapper))
return false;
return true;
}