Hi altogether,
I'm still working on the Ruby-ORM-Adapter to OrientDB, focussing on the
behavior of embedded lists, lightweight edges
In Ruby they are serialized as ordinary Arrays. Thus - they should behave
like Arrays in the ORM-Adapter, too.
In Ruby the method "<<" is used to add an element to an array, thus in
activeOrient after initializing the Classes TestMode and LinkClass this code
59 new_record = TestModel.new_instance ll: [ ]
# new document with an empty array
60 (1..9).each do |i|
61 new_record.ll << LinkClass.new_instance( att: "#{i} attribute"
)
62 new_record.ll << i
63 end
creates an Array with 18 Elements:
1 attribute ; 1 ; 2 attribute ; 2 ; 3 attribute ; 3 ; 4 attribute ; 4 ; 5
attribute ; 5 ; 6 attribute ; 6 ; 7 attribute ; 7 ; 8 attribute ; 8 ; 9
attribute ; 9
each link to the LinkClass-Instance is followed by a Number
Now the surprise. When checking the Record in Studio I got:
METADATAPROPERTIES
@rid
@version
@class
ll
created_at
updated_at
#31:0
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/31:0>
7
ModelTest
<http://localhost:2480/studio/index.html#/database/hc_database/schema/editclass/ModelTest>
[5,"t",78]
2015-07-31T09:13:14.736 02:00
2015-07-31T09:13:14.736 02:00
#31:1
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/31:1>
19
ModelTest
<http://localhost:2480/studio/index.html#/database/hc_database/schema/editclass/ModelTest>
#33:0
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:0>
#33:1
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:1>
#33:2
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:2>
#33:3
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:3>
#33:4
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:4>
#33:5
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/33:5>
..More(3)
The Numeric-Items are ignored, only the links are displayed, and only 9
Array-Elements are detected.
However, if I reverse the order of entries (adding first the number then
the link), Studio does not recognize the links but displays all elements.
METADATAPROPERTIES
@rid
@version
@class
ll
created_at
updated_at
#31:0
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/31:0>
7
ModelTest
<http://localhost:2480/studio/index.html#/database/hc_database/schema/editclass/ModelTest>
[5,"t",78]
2015-07-31T09:30:43.522 02:00
2015-07-31T09:30:43.522 02:00
#31:1
<http://localhost:2480/studio/index.html#/database/hc_database/browse/edit/31:1>
19
ModelTest
<http://localhost:2480/studio/index.html#/database/hc_database/schema/editclass/ModelTest>
[1,"#33:0",2,"#33:1",3,"#33:2",4,"#33:3",5,"#33:4",6,"#33:5",7,"#33:6",8,"#33:7",9,"#33:8"]
10255010010005000
Am I bending the Datamodel of Orientdb to much or is this just a bug in
studio?
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" 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.