Fix detection of embedded documents in recursive copy
Resolves:
@@ -887,10 +887,9 @@ public class ODocumentHelper {
public static Object cloneValue(ODocument iCloned, final Object fieldValue) {
if (fieldValue != null) {
- if (fieldValue instanceof ODocument && !((ODocument) fieldValue).getIdentity().isValid()) {
+ if (fieldValue instanceof ODocument && ((ODocument) fieldValue).isEmbedded()) {
// EMBEDDED DOCUMENT
return ((ODocument) fieldValue).copy();
-
} else if (fieldValue instanceof ORidBag) {
ORidBag newBag = ((ORidBag) fieldValue).copy();
newBag.setOwner(null);
