Examples of CypherParser


Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachVehicle(String vehicleId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(vehicles, 'vehicleId:" + vehicleId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node vehicle = n_column.next();
            //Removing the node from the index
            this.vehiclesIndex.remove(vehicle);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachProcedure(String procedureId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(procedures, 'procedureId:" + procedureId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node procedure = n_column.next();
            //Removing the node from the index
            this.proceduresIndex.remove(procedure);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachEmergency(String emergencyId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(emergencies, 'emergencyId:" + emergencyId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node emergency = n_column.next();
            //Removing the node from the index
            this.emergenciesIndex.remove(emergency);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachServiceChannel(String serviceChannelId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(channels, 'channelId:" + serviceChannelId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node channel = n_column.next();
            //Removing the node from the index
            this.channelsIndex.remove(channel);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachPatient(String patientId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(patients, 'patientId:" + patientId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node patient = n_column.next();
            //Removing the node from the index
            this.channelsIndex.remove(patient);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

    @Override
    public void detachEmergencyEntityBuilding(String entityBuildingId) {
        Transaction tx = graphDb.beginTx();

        try {
            CypherParser parser = new CypherParser();
            ExecutionEngine engine = new ExecutionEngine(this.graphDb);
            Query query = parser.parse("start n=(buildings, 'buildingId:" + entityBuildingId + "')  return n");
            ExecutionResult result = engine.execute(query);
            Iterator<Node> n_column = result.columnAs("n");
            Node building = n_column.next();
            //Removing the node from the index
            this.buildingsIndex.remove(building);
View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

       
        trackingService.attachProcedure(e.getId(), procedure.getId());
       
       

        CypherParser parser = new CypherParser();

        ExecutionEngine engine = new ExecutionEngine(trackingService.getGraphDb());

        Query query = parser.parse("start n=(emergencies, 'emergencyId:*')  return n");

        ExecutionResult result = engine.execute(query);
        Iterator<Node> n_column = result.columnAs("n");


        System.out.println("results: " + result);
        while (n_column.hasNext()) {
            Node currentNode = n_column.next();
            for (String key : currentNode.getPropertyKeys()) {
                System.out.println("Property (" + key + "): " + currentNode.getProperty(key));
            }
        }
        assertEquals(1, result.size());
       
        query = parser.parse("start n=(procedures, 'procedureId:*')  return n");

        result = engine.execute(query);
        n_column = result.columnAs("n");


View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

        persistenceService.storeProcedure(procedure);
        assertEquals(1, persistenceService.getAllProcedures().size());

        trackingService.attachProcedure(e.getId(), procedure.getId());
       
        CypherParser parser = new CypherParser();

        ExecutionEngine engine = new ExecutionEngine(trackingService.getGraphDb());

        Query query = parser.parse("start n=(emergencies, 'emergencyId:*')  return n");

        ExecutionResult result = engine.execute(query);
        Iterator<Node> n_column = result.columnAs("n");


        System.out.println("results: " + result);
        while (n_column.hasNext()) {
            Node currentNode = n_column.next();
            for (String key : currentNode.getPropertyKeys()) {
                System.out.println("Property (" + key + "): " + currentNode.getProperty(key));
            }
        }
        assertEquals(1, result.size());
       
        query = parser.parse("start n=(procedures, 'procedureId:*')  return n");

        result = engine.execute(query);
        n_column = result.columnAs("n");


View Full Code Here

Examples of org.neo4j.cypher.javacompat.CypherParser

        }
    }

    private ExecutionResult parseAndExecuteQuery(String statement) {
        try {
            CypherParser parser = new CypherParser();
            Query query = parser.parse(statement);
            return executionEngine.execute(query);
        } catch(Exception e) {
            throw new InvalidDataAccessResourceUsageException("Error executing statement " + statement, e);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.