The technique turns out to be as follows:

    val version = new ODocument("Version")
      .field("id", "1.0")
    version.save()

    val versions = new java.util.HashSet[ODocument]()
    versions.add(version)
    val package = new ODocument("Package")
      .field("id", "MyPackage")
      .field("versions", versions)
    package.save()

Arve

On Fri, Mar 21, 2014 at 8:25 PM, Arve Knudsen <[email protected]>wrote:

> Hi guys
>
> How does one insert into a database an ODocument with a linkset pointing
> to other ODocuments from Scala?
>
> Consider the class Package, which can point to an arbitrary number of
> Versions. Let's say a package ODocument is stored like this:
>
>     val doc = new ODocument("Package")
>       .field("id", "MyPackage")
>       // How to add linkset of Version ODocuments?
>     doc.store()
>
> How should I store a linkset of ODocuments representing Versions along
> with the above Package document?
>
> Thanks,
> Arve
>

-- 

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