Package org.apache.jackrabbit.oak.plugins.document.UpdateOp

Examples of org.apache.jackrabbit.oak.plugins.document.UpdateOp.Operation


        }
    }

    public static boolean checkConditions(@Nonnull Document doc, @Nonnull UpdateOp update) {
        for (Map.Entry<Key, Operation> change : update.getChanges().entrySet()) {
            Operation op = change.getValue();
            if (op.type == Operation.Type.CONTAINS_MAP_ENTRY) {
                Key k = change.getKey();
                Revision r = k.getRevision();
                if (r == null) {
                    throw new IllegalStateException("CONTAINS_MAP_ENTRY must not contain null revision");
View Full Code Here


            T target = collection.newDocument(this);
            UpdateUtils.applyChanges(target, update, comparator);
            docs.add(target);
            for (Entry<Key, Operation> entry : update.getChanges().entrySet()) {
                Key k = entry.getKey();
                Operation op = entry.getValue();
                switch (op.type) {
                    case SET:
                    case MAX:
                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
View Full Code Here

                                              boolean checkConditions) {
        QueryBuilder query = getByKeyQuery(updateOp.getId());

        for (Entry<Key, Operation> entry : updateOp.getChanges().entrySet()) {
            Key k = entry.getKey();
            Operation op = entry.getValue();
            switch (op.type) {
                case CONTAINS_MAP_ENTRY: {
                    if (checkConditions) {
                        query.and(k.toString()).exists(op.value);
                    }
View Full Code Here

            Key k = entry.getKey();
            if (k.getName().equals(Document.ID)) {
                // avoid exception "Mod on _id not allowed"
                continue;
            }
            Operation op = entry.getValue();
            switch (op.type) {
                case SET:
                case SET_MAP_ENTRY: {
                    setUpdates.append(k.toString(), op.value);
                    break;
View Full Code Here

     */
    public String asString(UpdateOp update) {
        StringBuilder sb = new StringBuilder("[");
        boolean needComma = false;
        for (Map.Entry<Key, Operation> change : update.getChanges().entrySet()) {
            Operation op = change.getValue();
            Key key = change.getKey();

            // exclude properties that are serialized into special columns
            if (columnProperties.contains(key.getName()) && null == key.getRevision())
                continue;
View Full Code Here

    }

    /* check whether this update operation requires knowledge about the previous state */
    private static boolean requiresPreviousState(UpdateOp update) {
        for (Map.Entry<Key, Operation> change : update.getChanges().entrySet()) {
            Operation op = change.getValue();
            if (op.type == UpdateOp.Operation.Type.CONTAINS_MAP_ENTRY) return true;
        }
        return false;
    }
View Full Code Here

        return false;
    }

    private static long  getModifiedFromUpdate(UpdateOp update) {
        for (Map.Entry<Key, Operation> change : update.getChanges().entrySet()) {
            Operation op = change.getValue();
            if (op.type == UpdateOp.Operation.Type.MAX || op.type == UpdateOp.Operation.Type.SET) {
                if (MODIFIED.equals(change.getKey().getName())) {
                    return Long.parseLong(op.value.toString());
                }
            }
View Full Code Here

    }

    private boolean hasChangesToCollisions(UpdateOp update) {
        for (Entry<Key, Operation> e : checkNotNull(update).getChanges().entrySet()) {
            Key k = e.getKey();
            Operation op = e.getValue();
            if (op.type == Operation.Type.SET_MAP_ENTRY) {
                if (NodeDocument.COLLISIONS.equals(k.getName())) {
                    return true;
                }
            }
View Full Code Here

            T target = collection.newDocument(this);
            UpdateUtils.applyChanges(target, update, comparator);
            docs.add(target);
            for (Entry<Key, Operation> entry : update.getChanges().entrySet()) {
                Key k = entry.getKey();
                Operation op = entry.getValue();
                switch (op.type) {
                    case SET:
                    case INCREMENT: {
                        inserts[i].put(k.toString(), op.value);
                        break;
View Full Code Here

                                              boolean checkConditions) {
        QueryBuilder query = getByKeyQuery(updateOp.getId());

        for (Entry<Key, Operation> entry : updateOp.getChanges().entrySet()) {
            Key k = entry.getKey();
            Operation op = entry.getValue();
            switch (op.type) {
                case CONTAINS_MAP_ENTRY: {
                    if (checkConditions) {
                        query.and(k.toString()).exists(op.value);
                    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.plugins.document.UpdateOp.Operation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.