[英]Create schema for graph database with Java in OrientDB
我正在嘗試使用Java在OrientDB中為圖形數據庫創建模式,但我有兩個問題我無法解決。 我正在使用這個例子http://orientdb.com/docs/last/Graph-Schema.html
OServerAdmin serverAdmin = new OServerAdmin("remote:localhost").connect("root", "1234");
serverAdmin.createDatabase("mydb", "graph", "plocal");
serverAdmin.close();
我收到以下錯誤:
java.lang.NoSuchMethodError:com.orientechnologies.common.concur.resource.OResourcePool.getAllResources()Ljava / util / Collection; 在com.orientechnologies.orient.client.r
它創建數據庫但僅此而已,因為我得到了該異常。
OrientGraph graph = new OrientGraph("remote:localhost/mydb", "root", "1234");
OrientVertexType userVType = graph.createVertexType("User");
userVType.createProperty("email", OType.STRING)
// ...
它工作正常,但它會嘗試每次運行程序時創建模式,我得到的錯誤消息,如用戶類已經存在等等。所以我想知道我怎么能檢查數據庫和模式是否已經存在或者是哪個是在OrientDB中使用Java創建模式的正確方法?
在這里看到我展示了一個關於創建圖形數據庫的完整示例。
關於導入的一些要點:
我在我的最新項目中使用這種導入方式並且沒有任何問題。 我還創建了一種保存舊功能的技術,導入后我將其恢復。
如果您需要更多信息,請告訴我,我會在這里添加。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.