Package com.orientechnologies.orient.core.id

Examples of com.orientechnologies.orient.core.id.ORID


    Child setChild3 = database.newInstance(Child.class);
    setChild3.setName("set3");
    test.getSet().add(setChild3);

    database.save(test);
    ORID testRid = database.getRecordByUserObject(test, false).getIdentity();
    ORID list1Rid = database.getRecordByUserObject(listChild1, false).getIdentity();
    ORID set2Rid = database.getRecordByUserObject(setChild2, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    database.delete(list1Rid);
    database.delete(set2Rid);
View Full Code Here


    Child mapChild3 = database.newInstance(Child.class);
    mapChild3.setName("map3");
    test.getChildren().put("3", mapChild3);

    database.save(test);
    ORID testRid = database.getRecordByUserObject(test, false).getIdentity();
    ORID map1Rid = database.getRecordByUserObject(mapChild1, false).getIdentity();
    ORID map2Rid = database.getRecordByUserObject(mapChild2, false).getIdentity();
    ORID map3Rid = database.getRecordByUserObject(mapChild3, false).getIdentity();

    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");


    database.delete(testRid);
    mapChild1 = database.load(map1Rid);
    mapChild2 = database.load(map2Rid);
    mapChild3 = database.load(map3Rid);
    Assert.assertNull(mapChild1);
    Assert.assertNull(mapChild2);
    Assert.assertNull(mapChild3);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");


    // MAP UPDATE TEST
    test = database.newInstance(JavaCascadeDeleteTestClass.class);
    mapChild1 = database.newInstance(Child.class);
    mapChild1.setName("map1");
    test.getChildren().put("1", mapChild1);
    mapChild2 = database.newInstance(Child.class);
    mapChild2.setName("map2");
    test.getChildren().put("2", mapChild2);
    mapChild3 = database.newInstance(Child.class);
    mapChild3.setName("map3");
    test.getChildren().put("3", mapChild3);
    Child mapChild4 = database.newInstance(Child.class);
    mapChild4.setName("map4");
    test.getChildren().put("4", mapChild4);
    Child mapChild5 = database.newInstance(Child.class);
    mapChild5.setName("map5");
    test.getChildren().put("5", mapChild5);

    database.save(test);
    testRid = database.getIdentity(test);
    map1Rid = database.getRecordByUserObject(mapChild1, false).getIdentity();
    map2Rid = database.getRecordByUserObject(mapChild2, false).getIdentity();
    map3Rid = database.getRecordByUserObject(mapChild3, false).getIdentity();
    ORID map4Rid = database.getRecordByUserObject(mapChild4, false).getIdentity();
    ORID map5Rid = database.getRecordByUserObject(mapChild5, false).getIdentity();
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");

    test = database.load(testRid);
    Assert.assertNotNull(test.getChildren().get("1"));
View Full Code Here

  }

  @Test(dependsOnMethods = "testCustomTypes")
  public void testCustomTypesDatabaseNewInstance() {
    OObjectDatabaseTx database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    ORID rid = null;
    try {
      // init counters
      serialized = 0;
      unserialized = 0;
View Full Code Here

  }

  @Test(dependsOnMethods = "testCustomTypesDatabaseNewInstance")
  public void testEnumListWithCustomTypes() {
    OObjectDatabaseTx database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    ORID rid = null;
    try {
      OObjectSerializerContext serializerContext = new OObjectSerializerContext();
      serializerContext.bind(new OObjectSerializer<SecurityRole, String>() {

        @Override
View Full Code Here

    p.setName("Earth");
    p.setDistanceSun(1000);
    sat.setDiameter(50);
    p.addSatellite(sat);
    database.save(p);
    ORID rid = database.getIdentity(p);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    p = database.load(rid);
    sat = p.getSatellites().get(0);
    Assert.assertEquals(sat.getDiameter(), 50);
View Full Code Here

    sat.setNear(near);
    satNear.setDiameter(10);
    near.addSatellite(satNear);
    p.addSatellite(sat);
    database.save(p);
    ORID rid = database.getIdentity(p);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    p = database.load(rid);
    sat = p.getSatellites().get(0);
    near = sat.getNear();
View Full Code Here

    sat.setName("Moon");
    p.addSatelliteMap(sat);
    database.save(p);
    Assert.assertEquals(p.getDistanceSun(), 1000);
    Assert.assertEquals(p.getName(), "Earth");
    ORID rid = database.getIdentity(p);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    p = database.load(rid);
    sat = p.getSatellitesMap().get("Moon");
    Assert.assertEquals(p.getDistanceSun(), 1000);
View Full Code Here

    mercuryMoon.setDiameter(10);
    mercuryMoon.setName("MercuryMoon");
    mercury.addSatelliteMap(mercuryMoon);
    jupiter.addSatelliteMap(jupiterMoon);
    database.save(jupiter);
    ORID rid = database.getIdentity(jupiter);
    database.close();
    database = OObjectDatabasePool.global().acquire(url, "admin", "admin");
    jupiter = database.load(rid);
    jupiterMoon = jupiter.getSatellitesMap().get("JupiterMoon");
    mercury = jupiterMoon.getNear();
View Full Code Here

     setDataCommandInfo("Delete record");

     if (!isConnectionAlive())
       return;

     final ORID rid = channel.readRID();
     final ORecordVersion version = channel.readVersion();
     final byte mode = channel.readByte();

     final int result = deleteRecord(connection.database, rid, version);
View Full Code Here

     setDataCommandInfo("Hide record");

     if (!isConnectionAlive())
       return;

     final ORID rid = channel.readRID();
     final byte mode = channel.readByte();

     final int result = hideRecord(connection.database, rid);

     if (mode < 2) {
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.id.ORID

Copyright © 2018 www.massapicom. 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.