/** * Sets the unprojected output document to a copy of output document */ public void copyUpdatedDocFromOutputDoc() { if (outputDoc != null) { updatedDoc = outputDoc.copy(); } }
/** * Sets the unprojected output document to a copy of output document */ public void copyUpdatedDocFromOutputDoc() { if (outputDoc != null) { updatedDoc = outputDoc.copy(); } }
public HookDocInfo(DocCtx doc) { op = doc.getCRUDOperationPerformed(); // Create a copy of the original version of the document, if non-null if (op == CRUDOperation.INSERT || op == CRUDOperation.FIND) { pre = null; } else { JsonDoc preDoc = doc.getOriginalDocument(); if (preDoc != null) { pre = preDoc.copy(); } else { pre = null; } } // If we're deleting, post copy is null if (op == CRUDOperation.DELETE) { post = null; } else if (doc.getUpdatedDocument() != null) { post = doc.getUpdatedDocument().copy(); } else if (doc.getOriginalDocument() == doc && pre != null) { post = pre; } else { post = doc.copy(); } } }
public HookDocInfo(DocCtx doc) { op = doc.getCRUDOperationPerformed(); // Create a copy of the original version of the document, if non-null if (op == CRUDOperation.INSERT || op == CRUDOperation.FIND) { pre = null; } else { JsonDoc preDoc = doc.getOriginalDocument(); if (preDoc != null) { pre = preDoc.copy(); } else { pre = null; } } // If we're deleting, post copy is null if (op == CRUDOperation.DELETE) { post = null; } else if (doc.getUpdatedDocument() != null) { post = doc.getUpdatedDocument().copy(); } else if (doc.getOriginalDocument() == doc && pre != null) { post = pre; } else { post = doc.copy(); } } }
public DocHooks(DocCtx doc, Map<Hook, CRUDHook> hooks) { op = doc.getOperationPerformed(); // Create a copy of the original version of the document, if non-null if (op == Operation.INSERT || op == Operation.FIND) { pre = null; } else { JsonDoc preDoc = doc.getOriginalDocument(); if (preDoc != null) { pre = preDoc.copy(); } else { pre = null; } } // If original copy is the same instance as the document // copy, use the same pre value as post value otherwise, // copy the doc and use that as the post value // If we're deleting, post copy is null if (op == Operation.DELETE) { post = null; } else { if (doc.getOriginalDocument() == doc && pre != null) { post = pre; } else { post = doc.copy(); } } this.hooks = hooks; } }