Hi altogether,

The ObjectModel of OrientDB surprises me once more.
Perhaps someone can clarify this

I got a bunch of Vertex-classes and two Edge-classes.


  5 ORD.create_vertex_class :stillhalter
  6 ORD.create_vertex_class :a
  7 ORD.create_classes [ :aktie, :option, :future, :waehrung ] { :a }
  8 ORD.create_edge_class :ist_componente
  9 ORD.create_class( :ist_underlying ){ :ist_componente }


which provides this hierarchy
- - E
     - ist_componente

       - ist_underlying
- - V
    - a
       - aktie
       - future
       - option
       - waehrung
    - stillhalter


If I allocate Objects and connect them via Edges
 14       b =  HC::Basiswert.create name: WordPicker.random.capitalize  
 15       a =  HC::Aktie.create  symbol: WordPicker.random.upcase[0..3] , 
basiswert: b
 16       o1 = HC::Option.create  expiry: Date.today , right: 'put', 
basiswert: b
 17       o2 = HC::Option.create  expiry: Date.today , right: 'call', 
basiswert: b
 18       s =  HC::Stillhalter.create basiswert: b
 19       [o1,o2].each{ |c| HC::IstComponente.create from: c, to: s }
 20       HC::IstUnderlying.create from: a, to: s


three Edges are allocated:
HC::IstComponente.count                => 3 


But
s=HC::Stillhalter.first
s.in_ist_componente.out.size             => 2 


and an Inspection of the Database-Object reveals
=> #<HC::Stillhalter:0x000000047c4490 @metadata={"type"=>"d", 
"class"=>"stillhalter", "version"=>4, 
"fieldTypes"=>"in_ist_componente=g,basiswert=x,in_ist_underlying=g", 
"cluster"=>30, "record"=>2, 
"edges"=>{"in"=>["ist_componente", "ist_underlying"], "out"=>[]}}, @d=nil, 
@attributes={"in_ist_componente"=>["#64:4", "#61:5"], "basiswert"=>"#18:17", 
"in_ist_underlying"=>["#65:1"]



Thus .. Object-Inheritance is* not *maintained

Is this the intended behavior and why does the database break with the 
o-o-principles?



-- 

--- 
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.

Reply via email to