Results results = store.batch().copy(source).fromWorkspace(sourceWorkspace).to(destination).execute();
@Test public void shouldCopyNodeInBatches() { graph.batch().copy(validPath).into(validIdProperty1, validIdProperty2).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsCopy(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.batch().copy(validPathString).into(validIdProperty1, validIdProperty2).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsCopy(Location.create(validPath), Location.create(validIdProperty1, validIdProperty2)); assertNoMoreRequests(); graph.batch().copy(validUuid).into(validPath).execute(); assertThat(numberOfExecutions, is(1)); assertNextRequestIsCopy(Location.create(validUuid), Location.create(validPath)); .copy(validPath) .into(validIdProperty1, validIdProperty2) .and() .copy(validPathString) .into(validIdProperty1, validIdProperty2) .and() .copy(validUuid) .into(validPath) .execute();
cache.operations.copy(child.getLocation()).to(copyLocation);
/** * Begin the request to copy a node with the specified identification properties into a parent node at a different * location, which is specified via the <code>into(...)</code> method on the returned {@link Copy} object. The * identification properties should uniquely identify a single node. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param idProperties the identification properties of the node that is to be copied * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Iterable<Property> idProperties ) { return copy(Location.create(idProperties)); }
/** * Begin the request to copy a node with the specified identification properties into a parent node at a different * location, which is specified via the <code>into(...)</code> method on the returned {@link Copy} object. The * identification properties should uniquely identify a single node. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param firstIdProperty the first identification property of the node that is to be copied * @param additionalIdProperties the remaining identification properties of the node that is to be copied * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Property firstIdProperty, Property... additionalIdProperties ) { return copy(Location.create(firstIdProperty, additionalIdProperties)); }
/** * Begin the request to copy a node with the specified unique identification property into a parent node at a different * location, which is specified via the <code>into(...)</code> method on the returned {@link Copy} object. The * identification property should uniquely identify a single node. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param idProperty the unique identification property of the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Property idProperty ) { return copy(Location.create(idProperty)); }
/** * Begin the request to copy a node with the specified unique identifier into a parent node at a different location, which * is specified via the <code>into(...)</code> method on the returned {@link Copy} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param from the UUID of the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( UUID from ) { return copy(Location.create(from)); }
/** * Begin the request to copy a node located at the supplied path into a parent node at a different location, which is * specified via the <code>into(...)</code> method on the returned {@link Copy} object. * <p> * Like all other methods on the {@link Graph}, the copy request will be performed immediately when the * <code>into(...)</code> method is called. * </p> * * @param from the path to the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Path from ) { return copy(Location.create(from)); }
/** * Begin the request to copy the specified node into a parent node at a different location, which is specified via the * <code>into(...)</code> method on the returned {@link Copy} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param from the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( Node from ) { return copy(from.getLocation()); }
/** * Begin the request to copy a node located at the supplied path into a parent node at a different location, which is * specified via the <code>into(...)</code> method on the returned {@link Copy} object. * <p> * Like all other methods on the {@link Batch}, the request will be performed when the {@link #execute()} method is * called. * </p> * * @param fromPath the path to the node that is to be copied. * @return the object that can be used to specify addition nodes to be copied or the location of the node where the node * is to be copied */ public Copy<BatchConjunction> copy( String fromPath ) { return copy(Location.create(createPath(fromPath))); }