1
另一個問題aboit neo4j-jdbc驅動程序。根據REST API文檔有通過將地圖以創建節點的方式:Neo4j-jdbc散列表或json在準備語句中
Map<String, Object> props = new HashMap<String, Object>();
props.put("name", "Andres");
props.put("position", "Developer");
Map<String, Object> params = new HashMap<String, Object>();
params.put("props", props);
String query = "CREATE ({props})";
engine.execute(query, params);
我要創建有很多特性的節點,我這應該是一個JSON。有沒有辦法像這樣創建節點
JSONObject jsonObject = (JSONObject) JSONSerializer.toJSON(json);
Map<String, Object> map = (Map<String, Object>) JSONObject.toBean(jsonObject, Map.class);
...
connection = dataSource.getConnection();
PreparedStatement preparedStatement = connection.prepareStatement("CREATE (n{1}");
preparedStatement.setObject(1, map);
preparedStatement.executeQuery();
謝謝大家!
似乎是一個問題。 neo4j的谷歌集團的問題。 https://groups.google.com/forum/#!topic/neo4j/2kEfVieckUI – 0pipe0