Package com.orientechnologies.orient.core.record.impl

Examples of com.orientechnologies.orient.core.record.impl.ODocument.save()


    janeDoeID = janeDoe.getIdentity().copy();

    ODocument chuckNorris = new ODocument(database, WORKER);
    chuckNorris.field("name", "Chuck");
    chuckNorris.field("surname", "Norris");
    chuckNorris.save();
    chuckNorrisID = chuckNorris.getIdentity().copy();

    ODocument jackBauer = new ODocument(database, WORKER);
    jackBauer.field("name", "Jack");
    jackBauer.field("surname", "Bauer");
View Full Code Here


    chuckNorrisID = chuckNorris.getIdentity().copy();

    ODocument jackBauer = new ODocument(database, WORKER);
    jackBauer.field("name", "Jack");
    jackBauer.field("surname", "Bauer");
    jackBauer.save();
    jackBauerID = jackBauer.getIdentity().copy();

    ODocument ctu = new ODocument(database, WORKPLACE);
    ctu.field("name", "CTU");
    ctu.field("boss", jackBauer);
View Full Code Here

    ctu.field("boss", jackBauer);
    List<ODocument> workplace1Workers = new ArrayList<ODocument>();
    workplace1Workers.add(chuckNorris);
    workplace1Workers.add(janeDoe);
    ctu.field("workers", workplace1Workers);
    ctu.save();
    ctuID = ctu.getIdentity().copy();

    ODocument fbi = new ODocument(database, WORKPLACE);
    fbi.field("name", "FBI");
    fbi.field("boss", chuckNorris);
View Full Code Here

    fbi.field("boss", chuckNorris);
    List<ODocument> workplace2Workers = new ArrayList<ODocument>();
    workplace2Workers.add(chuckNorris);
    workplace2Workers.add(jackBauer);
    fbi.field("workers", workplace2Workers);
    fbi.save();
    fbiID = fbi.getIdentity().copy();

    car.field("owner", jackBauer);
    car.save();
    carID = car.getIdentity().copy();
View Full Code Here

    tags.add("nice");

    ODocument doc = new ODocument(database, "Profile");
    doc.field("tags", tags);

    doc.save();

    List<ODocument> resultset = database.query(new OSQLSynchQuery<ODocument>("select from Profile where tags CONTAINS 'smart'"));

    Assert.assertEquals(resultset.size(), 1);
    Assert.assertEquals(resultset.get(0).getIdentity(), doc.getIdentity());
View Full Code Here

    customReferences.put("second", new ODocument("name", "Jay", "surname", "Miner"));

    ODocument doc = new ODocument(database, "Profile");
    doc.field("customReferences", customReferences, OType.EMBEDDEDMAP);

    doc.save();

    List<ODocument> resultset = database.query(new OSQLSynchQuery<ODocument>(
        "select from Profile where customReferences CONTAINSKEY 'first'"));

    Assert.assertEquals(resultset.size(), 1);
View Full Code Here

    customReferences.put("second", new ODocument("name", "Jay", "surname", "Miner"));

    ODocument doc = new ODocument(database, "Profile");
    doc.field("customReferences", customReferences, OType.EMBEDDEDMAP);

    doc.save();

    List<ODocument> resultset = database.query(new OSQLSynchQuery<ODocument>(
        "select from Profile where customReferences.keys() CONTAINS 'first'"));

    Assert.assertEquals(resultset.size(), 1);
View Full Code Here

    database.open("admin", "admin");
    ODocument doc = new ODocument(database, "Person");
    doc.field("name", "Raf");
    doc.field("city", "Torino");
    doc.field("gender", "fmale");
    doc.save();
    checkUpdatedDoc(database, "Raf", "Torino", "fmale");

    /* THESE COMMANDS ARE OK */
    OCommandSQL updatecommand = new OCommandSQL("update Person set gender = 'female' where name = 'Raf'");
    database.command(updatecommand).execute("Raf");
View Full Code Here

    final long begin = System.currentTimeMillis();

    ODocument doc1 = new ODocument(database, "Order");
    doc1.field("context", "test");
    doc1.field("date", new Date());
    doc1.save();

    ODocument doc2 = new ODocument(database, "Order");
    doc2.field("context", "test");
    doc2.field("date", System.currentTimeMillis());
    doc2.save();
View Full Code Here

    doc1.save();

    ODocument doc2 = new ODocument(database, "Order");
    doc2.field("context", "test");
    doc2.field("date", System.currentTimeMillis());
    doc2.save();

    doc2.reload();
    Assert.assertTrue(doc2.field("date", OType.DATE) instanceof Date);

    doc2.reload();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.