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

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


    final ODocument res3doc = (ODocument) res3.get(0);
    Assert.assertTrue(res3doc.containsField("result"));
    Assert.assertTrue("FFFF".equalsIgnoreCase((String) res3doc.field("result"))
        || "Butch 1".equalsIgnoreCase((String) res3doc.field("result")));
    Assert.assertTrue(res3doc.containsField("rid"));
    Assert.assertTrue(res3doc.containsField("version"));

    // create record using content keyword and update it in sql batch passing recordID between commands
    final String sql2 = "let var1=INSERT INTO Actor2 CONTENT {Name:\"content\"} RETURN $current.@rid\n"
        + "let var2=UPDATE $var1 SET Bingo=1 RETURN AFTER @rid\n" + "return $var2\n" + "end";
    List<?> res_sql2 = database.command(new OCommandScript("sql", sql2)).execute();
View Full Code Here


    final ODocument loadedDoc = database.load(rid);

    Assert.assertTrue(newDoc.hasSameContentOf(loadedDoc));

    Assert.assertTrue(loadedDoc.containsField("map1"));
    Assert.assertTrue(loadedDoc.field("map1") instanceof Map<?, ?>);
    final Map<String, ODocument> loadedMap1 = loadedDoc.field("map1");
    Assert.assertEquals(loadedMap1.size(), 1);

    Assert.assertTrue(loadedMap1.containsKey("map2"));
View Full Code Here

  public void testEquals() {
    final List<ODocument> resultList = database.command(
        new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key = [2, 5]")).execute();
    Assert.assertEquals(resultList.size(), 1);
    final ODocument result = resultList.get(0);
    Assert.assertTrue(result.containsField("key"));
    Assert.assertTrue(result.containsField("rid"));
    Assert.assertEquals(result.<OIdentifiable> field("rid").getIdentity(), rids.get(25));
  }

  @Test
View Full Code Here

    final List<ODocument> resultList = database.command(
        new OCommandSQL("select * from index:SQLSelectCompositeIndexDirectSearchTestIndex where key = [2, 5]")).execute();
    Assert.assertEquals(resultList.size(), 1);
    final ODocument result = resultList.get(0);
    Assert.assertTrue(result.containsField("key"));
    Assert.assertTrue(result.containsField("rid"));
    Assert.assertEquals(result.<OIdentifiable> field("rid").getIdentity(), rids.get(25));
  }

  @Test
  public void testEqualsHashIndex() {
View Full Code Here

  public void testEqualsHashIndex() {
    final List<ODocument> resultList = database.command(
        new OCommandSQL("select * from index:SQLSelectCompositeHashIndexDirectSearchTestIndex where key = [2, 5]")).execute();
    Assert.assertEquals(resultList.size(), 1);
    final ODocument result = resultList.get(0);
    Assert.assertTrue(result.containsField("key"));
    Assert.assertTrue(result.containsField("rid"));
    Assert.assertEquals(result.<OIdentifiable> field("rid").getIdentity(), rids.get(25));
  }

  @Test
View Full Code Here

    final List<ODocument> resultList = database.command(
        new OCommandSQL("select * from index:SQLSelectCompositeHashIndexDirectSearchTestIndex where key = [2, 5]")).execute();
    Assert.assertEquals(resultList.size(), 1);
    final ODocument result = resultList.get(0);
    Assert.assertTrue(result.containsField("key"));
    Assert.assertTrue(result.containsField("rid"));
    Assert.assertEquals(result.<OIdentifiable> field("rid").getIdentity(), rids.get(25));
  }

  @Test
  public void testBetween() throws Exception {
View Full Code Here

    attach.enumMap = new HashMap<String, EnumTest>();
    attach.enumMap.put("1", EnumTest.ENUM2);
    attach.enumMap.put("2", EnumTest.ENUM3);
    database.attach(attach);
    ODocument doc = database.getRecordByUserObject(attach, false);
    Assert.assertTrue(!doc.containsField("testStatic"));
    Assert.assertTrue(!doc.containsField("testTransient"));
    Assert.assertEquals(doc.field("text"), "test");
    Assert.assertEquals(doc.field("numberSimple"), 12345);
    Assert.assertEquals(doc.field("doubleSimple"), 12.34d);
    Assert.assertEquals(doc.field("floatSimple"), 123.45f);
View Full Code Here

    attach.enumMap.put("1", EnumTest.ENUM2);
    attach.enumMap.put("2", EnumTest.ENUM3);
    database.attach(attach);
    ODocument doc = database.getRecordByUserObject(attach, false);
    Assert.assertTrue(!doc.containsField("testStatic"));
    Assert.assertTrue(!doc.containsField("testTransient"));
    Assert.assertEquals(doc.field("text"), "test");
    Assert.assertEquals(doc.field("numberSimple"), 12345);
    Assert.assertEquals(doc.field("doubleSimple"), 12.34d);
    Assert.assertEquals(doc.field("floatSimple"), 123.45f);
    Assert.assertEquals(doc.field("longSimple"), 12345678l);
View Full Code Here

    attach.enumMap = new HashMap<String, EnumTest>();
    attach.enumMap.put("1", EnumTest.ENUM2);
    attach.enumMap.put("2", EnumTest.ENUM3);
    database.attach(attach);
    ODocument doc = database.getRecordByUserObject(attach, false);
    Assert.assertTrue(!doc.containsField("testStatic"));
    Assert.assertTrue(!doc.containsField("testTransient"));
    Assert.assertEquals(doc.field("text"), "test");
    Assert.assertEquals(doc.field("numberSimple"), 12345);
    Assert.assertEquals(doc.field("doubleSimple"), 12.34d);
    Assert.assertEquals(doc.field("floatSimple"), 123.45f);
View Full Code Here

    attach.enumMap.put("1", EnumTest.ENUM2);
    attach.enumMap.put("2", EnumTest.ENUM3);
    database.attach(attach);
    ODocument doc = database.getRecordByUserObject(attach, false);
    Assert.assertTrue(!doc.containsField("testStatic"));
    Assert.assertTrue(!doc.containsField("testTransient"));
    Assert.assertEquals(doc.field("text"), "test");
    Assert.assertEquals(doc.field("numberSimple"), 12345);
    Assert.assertEquals(doc.field("doubleSimple"), 12.34d);
    Assert.assertEquals(doc.field("floatSimple"), 123.45f);
    Assert.assertEquals(doc.field("longSimple"), 12345678l);
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.