0
大家好(再次), 我想加入兩個東方db類。 我想要兩個類的所有記錄和屬性。 由於這裏加入沒有作品,所以請給我建議,在東方分貝如何參加工作 並請建議我怎麼也使用邊緣在orientdbOrientDB:加入OrientDB - 如何
大家好(再次), 我想加入兩個東方db類。 我想要兩個類的所有記錄和屬性。 由於這裏加入沒有作品,所以請給我建議,在東方分貝如何參加工作 並請建議我怎麼也使用邊緣在orientdbOrientDB:加入OrientDB - 如何
其相當簡單連接:寫擺脫了目標記錄到在一個領域你的主表。
我將介紹使用activeorient,紅寶石orientDB ORM:
DB.create_class :basiswert
=> Basiswert
DB.create_class :stock
=> Stock
apple = Basiswert.create name: 'Apple', kind: 'silicon valley company'
=> #<Basiswert:0x0000000241ca38 @metadata={"type"=>"d", "class"=>"basiswert", "version"=>1, "fieldTypes"=>nil, "cluster"=>53, "record"=>0}, @d=nil, @attributes={"name"=>"Apple", "kind"=>"silicon valley company", "created_at"=>Fri, 24 Feb 2017 16:55:37 +0100}>
apple_stock = Stock.create symbol: 'AAPL', :price => 200, basiswert: apple
=> #<Stock:0x00000003ecb370 @metadata={"type"=>"d", "class"=>"stock", "version"=>1, "fieldTypes"=>"basiswert=x", "cluster"=>57, "record"=>0}, @d=nil, @attributes={"symbol"=>"AAPL", "price"=>200, "basiswert"=>"#53:0", "created_at"=>Fri, 24 Feb 2017 16:55:43 +0100}>
apple_stock.basiswert
=> #<Basiswert:0x0000000241ca38 @metadata={"type"=>"d", "class"=>"basiswert", "version"=>1, "fieldTypes"=>nil, "cluster"=>53, "record"=>0}, @d=nil, @attributes={"name"=>"Apple", "kind"=>"silicon valley company", "created_at"=>Fri, 24 Feb 2017 16:55:37 +0100}>
或者你只要把 「#53:0」 到»蘋果stock.basiswert«
這是一個單向的加入(或簡單的鏈接)。 很明顯,你可以查詢股票類
Stock.where basiswert: apple-stock.rid
或純OrientDB-SQL
select from stock where basiswert= "#53:0"
在東方沒有任何加盟怎麼一回事,因爲是一個圖形數據庫。你可以看到這個[documentation](http://orientdb.com/docs/2.2/Tutorial-Working-with-graphs.html) –
你能否添加一些例子來更好地解釋你的需求?日Thnx –
我有包含像這樣的 投訴表記錄拖表: RID |類|國家| ID | Sub_issue |投訴|產品| Date_rece |提交| SUB_PRODUCT SubIssue表: RID |類| Sub_issue_i | Sub_issue_name 我想加入這兩個表 – Kunal