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

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


      Assert.assertEquals(((Number) rec.field("id")).intValue(), i);
      Assert.assertEquals(rec.field("name"), "Gipsy");
      Assert.assertEquals(rec.field("location"), "Italy");
      Assert.assertEquals(((Number) rec.field("testLong")).longValue(), 10000000000L);
      Assert.assertEquals(((Number) rec.field("salary")).intValue(), i + 300);
      Assert.assertNotNull(rec.field("extra"));
      Assert.assertEquals(((Byte) rec.field("value", Byte.class)).byteValue(), (byte) 10);

      binary = rec.field("binary", OType.BINARY);

      for (int b = 0; b < binary.length; ++b)
View Full Code Here


      Assert.assertEquals(rec.field("name"), "Gipsy");
      Assert.assertEquals(rec.field("location"), "Italy");
      Assert.assertEquals(((Number) rec.field("testLong")).longValue(), 10000000000L);
      Assert.assertEquals(((Number) rec.field("salary")).intValue(), i + 300);
      Assert.assertNotNull(rec.field("extra"));
      Assert.assertEquals(((Byte) rec.field("value", Byte.class)).byteValue(), (byte) 10);

      binary = rec.field("binary", OType.BINARY);

      for (int b = 0; b < binary.length; ++b)
        Assert.assertEquals(binary[b], (byte) b);
View Full Code Here

      Assert.assertEquals(((Number) rec.field("testLong")).longValue(), 10000000000L);
      Assert.assertEquals(((Number) rec.field("salary")).intValue(), i + 300);
      Assert.assertNotNull(rec.field("extra"));
      Assert.assertEquals(((Byte) rec.field("value", Byte.class)).byteValue(), (byte) 10);

      binary = rec.field("binary", OType.BINARY);

      for (int b = 0; b < binary.length; ++b)
        Assert.assertEquals(binary[b], (byte) b);

      i++;
View Full Code Here

  public void testDoubleChanges() {
    database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");

    ODocument vDoc = database.newInstance();
    vDoc.setClassName("Profile");
    vDoc.field("nick", "JayM1").field("name", "Jay").field("surname", "Miner");
    vDoc.save();

    vDoc = database.load(vDoc.getIdentity());
    vDoc.field("nick", "JayM2");
    vDoc.field("nick", "JayM3");
View Full Code Here

    vDoc.setClassName("Profile");
    vDoc.field("nick", "JayM1").field("name", "Jay").field("surname", "Miner");
    vDoc.save();

    vDoc = database.load(vDoc.getIdentity());
    vDoc.field("nick", "JayM2");
    vDoc.field("nick", "JayM3");
    vDoc.save();

    OPropertyIndex index = database.getMetadata().getSchema().getClass("Profile").getProperty("nick").getIndex();
View Full Code Here

    vDoc.field("nick", "JayM1").field("name", "Jay").field("surname", "Miner");
    vDoc.save();

    vDoc = database.load(vDoc.getIdentity());
    vDoc.field("nick", "JayM2");
    vDoc.field("nick", "JayM3");
    vDoc.save();

    OPropertyIndex index = database.getMetadata().getSchema().getClass("Profile").getProperty("nick").getIndex();

    Collection<OIdentifiable> vOldName = index.getUnderlying().get("JayM1");
View Full Code Here

  public void testMultiValues() {
    database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");

    ODocument vDoc = database.newInstance();
    vDoc.setClassName("Profile");
    vDoc.field("nick", "Jacky").field("name", "Jack").field("surname", "Tramiel");
    vDoc.save();

    // add a new record with the same name "nameA".
    vDoc = database.newInstance();
    vDoc.setClassName("Profile");
View Full Code Here

    vDoc.save();

    // add a new record with the same name "nameA".
    vDoc = database.newInstance();
    vDoc.setClassName("Profile");
    vDoc.field("nick", "Jack").field("name", "Jack").field("surname", "Bauer");
    vDoc.save();

    OPropertyIndex indexName = database.getMetadata().getSchema().getClass("Profile").getProperty("name").getIndex();

    // We must get 2 records for "nameA".
View Full Code Here

  public void testUnderscoreField() {
    database = ODatabaseDocumentPool.global().acquire(url, "admin", "admin");

    ODocument vDoc = database.newInstance();
    vDoc.setClassName("Profile");
    vDoc.field("nick", "MostFamousJack").field("name", "Kiefer").field("surname", "Sutherland")
        .field("tag_list", new String[] { "actor", "myth" });
    vDoc.save();

    List<ODocument> result = database.command(
        new OSQLSynchQuery<ODocument>("select from Profile where name = 'Kiefer' and tag_list.size() > 0 ")).execute();
View Full Code Here

    Set<String> tags = new HashSet<String>();
    tags.add("test");
    tags.add("yeah");

    vDoc.field("nick", "Dexter").field("name", "Michael").field("surname", "Hall").field("tag_list", tags);
    vDoc.save();

    List<ODocument> result = database.command(new OSQLSynchQuery<ODocument>("select from Profile where name = 'Michael'"))
        .execute();
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.