Hey Aris,
You're close. In place of the ODocument, use an OrientVertex for
properties and city.
The OrientVertex will turn a passed-in ODocument that's embedded into an
OrientVertex wrapping the ODocument. So, just use an OrientVertex directly.
Just think of an OrientVertex as containing an ODocument with enhanced
features. There's no harm in using it like an ODocument, even if you never
create edges.
Since you're already in the Graph Database, it makes it simpler to stay
there.
-Colin
Orient Technologies
The Company behind OrientDB
On Tuesday, March 24, 2015 at 4:47:06 AM UTC-5, Aris Alexis wrote:
>
> Hi,
>
> sorry that I still have questions over this.
>
> To make it clear:
>
> I have Vertex v. I am using the Graph database. I have declared the
> property "properties" as type EMBEDDED
>
> then I do
>
> ODocument doc = new ODocument("Properties");
> doc.field( "city", new
> ODocument("City").field("name","Rome").field("country", "Italy") );
>
> then I set v.setProperty("properties",doc);
>
> and g.commit. note that g is a graph connection and I am not using the
> Document db connection.
>
> is this a correct flow?
>
>
>
> On Monday, March 23, 2015 at 1:37:06 PM UTC+1, Aris Alexis wrote:
>>
>> hi,
>>
>> sorry for the noob question but i am using the graph database but some
>> vertices i would like them to be documents.
>> for example the user vertex has a lot of sub documents for the location,
>> phones etc.
>>
>> can I do in my code ODocument od=vertex? and then how to save it? can I
>> use the variables then like od.phones[0] or something?
>>
>> do I have to open a new transactional connection to a document database
>> or work with my existing connection for graph?
>>
>> thanks
>>
>>
--
---
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.