更改不会反映到OrientDB中的数据库
我正在努力使它工作。这只是一个来自(假定的)文档的普通代码,尽管它工作正常,但数据库中没有任何更改!我看不到名为V1的新类!我使用的是2.0.7和Java1.7更改不会反映到OrientDB中的数据库,orientdb,Orientdb,我正在努力使它工作。这只是一个来自(假定的)文档的普通代码,尽管它工作正常,但数据库中没有任何更改!我看不到名为V1的新类!我使用的是2.0.7和Java1.7 OrientGraphFactory factory = new OrientGraphFactory("plocal:D:/orientdb/databases/GratefulDeadConcerts"); OrientGraphNoTx graph = factory.getNoTx(); try{ OClass V =
OrientGraphFactory factory = new OrientGraphFactory("plocal:D:/orientdb/databases/GratefulDeadConcerts");
OrientGraphNoTx graph = factory.getNoTx();
try{
OClass V = graph.getRawGraph().getMetadata().getSchema().getClass("V");
OClass V1 = graph.getRawGraph().getMetadata().getSchema().createClass("V1", V);
V1.createProperty("prop1", OType.STRING);
V1.createProperty("prop2", OType.STRING);
ODocument od = new ODocument(V1);
od.field("prop1", "value1");
od.field("prop2", "value2");
od.save();
} catch( Exception e ) {
System.out.println("ERROR:"+e.getMessage());
graph.rollback();
}
finally {
graph.shutdown();
factory.close();
}
那段代码是有效的。如何验证没有名为V1的类?@vitorenesduarte,因为我在Orientdb Studio中没有看到它