public static void createAndLinkWheels(String carOrid)
    {
        final ODatabaseDocumentInternal db = 
ODatabaseRecordThreadLocal.INSTANCE.get();
        
        db.begin();

        //insert wheel
        ODocument wheel = new ODocument("wheel");
        wheel.field( "type", "14");
        wheel.save();
    
        //link wheel
        db.command(new OCommandSQL("create edge car_has_wheel from " + 
carOrid + " to " + wheel.getIdentity().toString())).execute();

        db.commit();
    }
    
    public static void createAndLinkTyres(String wheelOrid)
    {
        final ODatabaseDocumentInternal db = 
ODatabaseRecordThreadLocal.INSTANCE.get();
        
        db.begin();

        //insert tyre
        ODocument tyre = new ODocument("tyre");
        tyre.field( "brand", "Michelin");
        tyre.save();
    
        //link tyre
        db.command(new OCommandSQL("create edge wheel_has_tyre from " + 
wheelOrid + " to " + tyre.getIdentity().toString())).execute();

        db.commit();
    }

But wheelOrid comes in as negative and wheel.getIdentity().toString() is 
negative too!

-- 

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