Examples of OGraphVertex


Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

//      database.getMetadata().getSchema().createClass("GraphMotocycle", vehicleClass);
//    }

    int existants = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle")).size();

    OGraphVertex carNode = database.createVertex("GraphCar").set("brand", "Hyundai").set("model", "Coupe").set("year", 2003).save();
    OGraphVertex motoNode = database.createVertex("GraphMotocycle").set("brand", "Yamaha").set("model", "X-City 250")
        .set("year", 2009).save();

    List<OGraphVertex> result = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle"));
    Assert.assertEquals(result.size(), 2 + existants);
    for (OGraphVertex v : result) {
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

  @Test(dependsOnMethods = "populate")
  public void testMultiEdgeWithSameVertex() {
    database.open("admin", "admin");

    OGraphVertex lucaNode = database.createVertex().set("name", "Luca").set("surname", "Garulli").save();
    OGraphVertex carNode = database.createVertex("GraphCar").set("brand", "Hyundai").set("model", "Coupe").set("year", 2003).save();
    OGraphVertex motoNode = database.createVertex("GraphMotocycle").set("brand", "Yamaha").set("model", "X-City 250")
        .set("year", 2009).save();

    lucaNode.link(carNode).setLabel("drives");

    lucaNode.link(carNode).setLabel("owns");
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

  @Override
  public OGraphVertex next(final String iFetchPlan) {
    final ODocument doc = underlying.next();

    OGraphVertex v = (OGraphVertex) database.getUserObjectByRecord(doc, null);

    if (v != null)
      return v;

    v = getObject();
    v.fromStream(doc);

    return v;
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

  public void populate() {
    database.open("admin", "admin");

    long time = System.currentTimeMillis();

    OGraphVertex rootNode = database.createVertex().set("id", 0);

    createSubNodes(rootNode, 0);

    rootId = rootNode.getId();

    database.setRoot("LinearGraph", rootNode);

    System.out.println("Creation of the graph with depth=" + MAX_DEEP + " and fixed density=1"
        + ((System.currentTimeMillis() - time) / 1000f) + " sec.");
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

      readSubNodesDirectly(vertex);
    }
  }

  private void createSubNodes(final OGraphVertex iNode, final int iDeepLevel) {
    OGraphVertex newNode;

    for (int i = 0; i < DENSITY; ++i) {
      newNode = database.createVertex().set("id", ++nodeWrittenCounter);
      iNode.link(newNode);
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

    database.declareIntent(new OIntentMassiveInsert());
    database.begin(TXTYPE.NOTX);

    long time = System.currentTimeMillis();

    OGraphVertex rootNode = database.createVertex().set("id", 0);

    System.out.println("Creating subnodes: ");

    nodeWrittenCounter = 1;
    createSubNodes(rootNode, 0, START_DENSITY);
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

      System.out.print(".");

    if (iDeepLevel > maxDeep)
      maxDeep = iDeepLevel;

    OGraphVertex newNode;

    for (int i = 0; i <= iDensity && nodeWrittenCounter < MAX_NODES; ++i) {
      newNode = database.createVertex().set("id", nodeWrittenCounter++);
      iNode.link(newNode);
      arcWrittenCounter++;
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

      database.getMetadata().getSchema().createClass("GraphMotocycle", vehicleClass);
    }

    int existants = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle")).size();

    OGraphVertex carNode = database.createVertex("GraphCar").set("brand", "Hyundai").set("model", "Coupe").set("year", 2003).save();
    OGraphVertex motoNode = database.createVertex("GraphMotocycle").set("brand", "Yamaha").set("model", "X-City 250")
        .set("year", 2009).save();

    List<OGraphVertex> result = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle"));
    Assert.assertEquals(result.size(), 2 + existants);
    for (OGraphVertex v : result) {
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

  @Test
  public void testMultiEdgeWithSameVertex() {
    database.open("admin", "admin");

    OGraphVertex lucaNode = database.createVertex().set("name", "Luca").set("surname", "Garulli").save();
    OGraphVertex carNode = database.createVertex("GraphCar").set("brand", "Hyundai").set("model", "Coupe").set("year", 2003).save();
    OGraphVertex motoNode = database.createVertex("GraphMotocycle").set("brand", "Yamaha").set("model", "X-City 250")
        .set("year", 2009).save();

    lucaNode.link(carNode).setLabel("drives");

    lucaNode.link(carNode).setLabel("owns");
View Full Code Here

Examples of com.orientechnologies.orient.core.db.graph.OGraphVertex

      database.getMetadata().getSchema().save();
    }

    int existants = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle")).size();

    OGraphVertex carNode = database.createVertex("GraphCar").set("brand", "Hyundai").set("model", "Coupe").set("year", 2003).save();
    OGraphVertex motoNode = database.createVertex("GraphMotocycle").set("brand", "Yamaha").set("model", "X-City 250")
        .set("year", 2009).save();

    List<OGraphVertex> result = database.query(new OSQLSynchQuery<OGraphVertex>("select from GraphVehicle"));
    Assert.assertEquals(result.size(), 2 + existants);
    for (OGraphVertex v : result) {
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.