Package org.jboss.dna.graph.commands.basic

Examples of org.jboss.dna.graph.commands.basic.BasicCreateNodeCommand


        final Path path = mergedNode.getPath();

        NodeConflictBehavior conflictBehavior = NodeConflictBehavior.UPDATE;
        Collection<Property> properties = new ArrayList<Property>(mergedNode.getPropertiesByName().size() + 1);
        properties.add(new BasicSingleValueProperty(this.uuidPropertyName, mergedNode.getUuid()));
        BasicCreateNodeCommand newNode = new BasicCreateNodeCommand(path, properties, conflictBehavior);
        List<Segment> children = mergedNode.getChildren();
        GraphCommand[] intoCache = new GraphCommand[1 + children.size()];
        int i = 0;
        intoCache[i++] = newNode;
        List<Property> noProperties = Collections.emptyList();
        PathFactory pathFactory = context.getValueFactories().getPathFactory();
        for (Segment child : mergedNode.getChildren()) {
            newNode = new BasicCreateNodeCommand(pathFactory.create(path, child), noProperties, conflictBehavior);
            // newNode.setProperty(new BasicSingleValueProperty(this.uuidPropertyName, mergedNode.getUuid()));
            intoCache[i++] = newNode;
        }
        cacheConnection.execute(context, intoCache);
    }
View Full Code Here

TOP

Related Classes of org.jboss.dna.graph.commands.basic.BasicCreateNodeCommand

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.