eu.drus.jpa.unit.neo4j.operation.DeleteAllOperation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jpa-unit-neo4j Show documentation
Show all versions of jpa-unit-neo4j Show documentation
JUnit extension for simple testing of JPA entities and components
The newest version!
package eu.drus.jpa.unit.neo4j.operation;
import static org.neo4j.cypherdsl.CypherQuery.match;
import java.sql.Connection;
import java.sql.SQLException;
import org.jgrapht.Graph;
import org.neo4j.cypherdsl.grammar.StartNext;
import eu.drus.jpa.unit.neo4j.dataset.Edge;
import eu.drus.jpa.unit.neo4j.dataset.Node;
public class DeleteAllOperation extends AbstractNeo4JOperation {
@Override
public void execute(final Connection connection, final Graph graph) throws SQLException {
for (final Node node : graph.vertexSet()) {
final StartNext match = match(node.toPath().withId("n").build());
executeQuery(connection, match.toString() + " DETACH DELETE n");
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy