Hi Vladimir,

In OrientDB graph model built on top of document one. So vertexes and edges
are able to do everything that can documents.

The model can contain any depth of nesting.
You can use types LINK and EMBEDDED to represent your specific case. There
are also collection types
like EMBEDDEDLIST, EMBEDDEDSET, EMBEDDEDMAP, LINKLIST, LINKSET, LINKMAP.
Take a look on wiki for more details.

The simple edges that don't contain any data are optimized end work pretty
similar to links, the only difference that edges are bidirectional
(represented by 2 links).
So in simple cases there is small performance overhead on handling edges,
but it is not significant.


Best regards,
Artem Orobets

*Orient Technologies the Company behind OrientDB*


2014-05-27 13:01 GMT+03:00 Vladimir Ziankevich <
[email protected]>:

> I am playing with OrientDB in graph mode.
> Is there any ability to create vertex(declare vertex type) with property
> of user non-primitive custom class?
>
> For example, There is type Car. Car has 'id', 'model' and 'engine'
> properties. id is Long, model is String. But can engine be of type Engine
> which for example is like
>
> public class Engine {
>         private String name;
>         private Long serialNumber;
>
>         public String getName() {
>             return name;
>         }
>
>         public void setName(String name) {
>             this.name = name;
>         }
>
>         public Long getSerialNumber() {
>             return serialNumber;
>         }
>
>         public void setSerialNumber(Long serialNumber) {
>             this.serialNumber = serialNumber;
>         }
>     }
> ?
>
> Or even more complex with embedded non-primitive property fuelSystem like
> public class Engine {
>         private String name;
>         private Long serialNumber;
>         private FuelSystem fuelSystem;
>
>         public String getName() {
>             return name;
>         }
>
>         public void setName(String name) {
>             this.name = name;
>         }
>
>         public Long getSerialNumber() {
>             return serialNumber;
>         }
>
>         public void setSerialNumber(Long serialNumber) {
>             this.serialNumber = serialNumber;
>         }
>
>         public FuelSystem getFuelSystem() {
>             return fuelSystem;
>         }
>
>         public void setFuelSystem(FuelSystem fuelSystem) {
>             this.fuelSystem = fuelSystem;
>         }
>     }
>
> I understand that this case is similar to Document DB. And for graph it is
> more natural to use separate vertex Engine and edge between Car and Engine.
>
> If using non-primitive properties is possible does it make a sense to use
> it instead of plain edges (f.e. performance benefits)?
> Is it possible to build query like
> select from Car where engine.name="Cosworth"
>
>  or
> select from Car where engine.fuelSystem.type="benzin"
>
>
>  --
>
> ---
> 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.
>

-- 

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