It is not giving any error also, but nodes are not created in the db. Please help if anyone have any idea about this.
-Sukaant Chaudhary <http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479> On Thu, Sep 18, 2014 at 11:43 AM, Sukaant Chaudhary < [email protected]> wrote: > Hi, > I'm using the following code. Please suggest why it is not creating the > nodes. > > GraphDatabaseService db = new GraphDatabaseFactory() > .newEmbeddedDatabase(NEO4J_DB_PATH); > ExecutionEngine engine = new ExecutionEngine(db); > Transaction transaction = db.beginTx(); > ExecutionResult result; > String query = "MERGE (ad:Ad {name: {name}, date: {date}}) ON > MATCH SET ad.reach = ad.reach + {reach}, ad.totalViewTime = > ad.totalViewTime + {totalViewTime} ON CREATE SET ad.reach = {reach}, > ad.totalViewTime = {totalViewTime} RETURN ad"; > Map<String, Object> paramValues = new HashMap<String, > Object>(); > paramValues.put("name", adNodePojo.getName()); > paramValues.put("date", adNodePojo.getDate()); > paramValues.put("reach", adNodePojo.getReach()); > paramValues.put("totalViewTime", > adNodePojo.getTotalViewTime()); > > result = engine.execute(query, paramValues); > > Iterator<Node> column = result.columnAs(AD_NODE_PROPERTY_NAME); > > for (Node node : IteratorUtil.asIterable(column)) { > System.out.println("Node: " + node); > System.out.println("Name: " + ": " + > node.getProperty("name")); > System.out.println("Date: " + ": " + > node.getProperty("date")); > System.out > .println("Reach: " + ": " + > node.getProperty("reach")); > System.out.println("View: " + ": " > + node.getProperty("totalViewTime")); > } > transaction.success(); > > > -Sukaant Chaudhary > <http://in.linkedin.com/pub/sukaant-chaudhary/33/ba8/479> > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
