Examples of createProperty()


Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

          OProperty prop = destClass.getProperty(linkName);
          if (prop != null)
            destClass.dropProperty(linkName);

          // CREATE THE PROPERTY
          destClass.createProperty(linkName, multipleRelationship ? OType.LINKLIST : OType.LINK, sourceClass);

        } else {

          // REMOVE THE OLD PROPERTY IF ANY
          OProperty prop = sourceClass.getProperty(linkName);
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

      vertex = underlying.getMetadata().getSchema()
          .createClass(OGraphDatabase.VERTEX_CLASS_NAME, underlying.addPhysicalCluster(OGraphDatabase.VERTEX_CLASS_NAME));
      edge = underlying.getMetadata().getSchema()
          .createClass(OGraphDatabase.EDGE_CLASS_NAME, underlying.addPhysicalCluster(OGraphDatabase.EDGE_CLASS_NAME));

      edge.createProperty(OGraphDatabase.EDGE_FIELD_IN, OType.LINK, vertex);
      edge.createProperty(OGraphDatabase.EDGE_FIELD_OUT, OType.LINK, vertex);

      vertex.createProperty(OGraphDatabase.VERTEX_FIELD_IN, OType.LINKSET, edge);
      vertex.createProperty(OGraphDatabase.VERTEX_FIELD_OUT, OType.LINKSET, edge);
    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

          .createClass(OGraphDatabase.VERTEX_CLASS_NAME, underlying.addPhysicalCluster(OGraphDatabase.VERTEX_CLASS_NAME));
      edge = underlying.getMetadata().getSchema()
          .createClass(OGraphDatabase.EDGE_CLASS_NAME, underlying.addPhysicalCluster(OGraphDatabase.EDGE_CLASS_NAME));

      edge.createProperty(OGraphDatabase.EDGE_FIELD_IN, OType.LINK, vertex);
      edge.createProperty(OGraphDatabase.EDGE_FIELD_OUT, OType.LINK, vertex);

      vertex.createProperty(OGraphDatabase.VERTEX_FIELD_IN, OType.LINKSET, edge);
      vertex.createProperty(OGraphDatabase.VERTEX_FIELD_OUT, OType.LINKSET, edge);
    } else {
      // @COMPATIBILITY <= 1.0rc4: CHANGE FROM outEdges -> out and inEdges -> in
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

  @Test
  public void saveLotOfMixedData() {
    database.open(DEFAULT_DB_USER, DEFAULT_DB_PASSWORD);
    OClass chunk = database.getMetadata().getSchema().createClass("Chunk");
    index = chunk.createProperty("hash", OType.STRING).createIndex(INDEX_TYPE.UNIQUE);
    chunk.createProperty("binary", OType.LINK);

    try {
      byte[] data = new byte[size];
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

  @Test
  public void saveLotOfMixedData() {
    database.open(DEFAULT_DB_USER, DEFAULT_DB_PASSWORD);
    OClass chunk = database.getMetadata().getSchema().createClass("Chunk");
    index = chunk.createProperty("hash", OType.STRING).createIndex(INDEX_TYPE.UNIQUE);
    chunk.createProperty("binary", OType.LINK);

    try {
      byte[] data = new byte[size];

      for (int i = 0; i < size; i++) {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

      try {
        OType type = OType.valueOf(fields.get("type"));

        OPropertyImpl prop;
        if (type == OType.LINK || type == OType.LINKLIST || type == OType.LINKSET || type == OType.LINKMAP)
          prop = (OPropertyImpl) cls.createProperty(fields.get("name"), type,
              db.getMetadata().getSchema().getClass(fields.get("linkedClass")));
        else
          prop = (OPropertyImpl) cls.createProperty(fields.get("name"), type);

        if (fields.get("linkedType") != null)
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

        OPropertyImpl prop;
        if (type == OType.LINK || type == OType.LINKLIST || type == OType.LINKSET || type == OType.LINKMAP)
          prop = (OPropertyImpl) cls.createProperty(fields.get("name"), type,
              db.getMetadata().getSchema().getClass(fields.get("linkedClass")));
        else
          prop = (OPropertyImpl) cls.createProperty(fields.get("name"), type);

        if (fields.get("linkedType") != null)
          prop.setLinkedType(OType.valueOf(fields.get("linkedType")));
        if (fields.get("mandatory") != null)
          prop.setMandatory("on".equals(fields.get("mandatory")));
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

      if (db.getMetadata().getSchema().getClass(urlParts[2]) == null)
        throw new IllegalArgumentException("Invalid class '" + urlParts[2] + "'");

      final OClass cls = db.getMetadata().getSchema().getClass(urlParts[2]);

      final OProperty prop = cls.createProperty(urlParts[3], OType.STRING);

      sendTextContent(iRequest, OHttpUtils.STATUS_CREATED_CODE, OHttpUtils.STATUS_CREATED_DESCRIPTION, null,
          OHttpUtils.CONTENT_TEXT_PLAIN, cls.properties().size());

    } finally {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

    record = database.newInstance();

    database.declareIntent(new OIntentMassiveInsert());
    OClass cl = database.createVertexType("Person", "OGraphVertex");
    cl.createProperty("id", OType.LONG);
    cl.createProperty("name", OType.STRING);
    cl.createProperty("surname", OType.STRING);
    cl.createProperty("birthDate", OType.DATE);
    cl.createProperty("salary", OType.FLOAT);
  }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass.createProperty()

    record = database.newInstance();

    database.declareIntent(new OIntentMassiveInsert());
    OClass cl = database.createVertexType("Person", "OGraphVertex");
    cl.createProperty("id", OType.LONG);
    cl.createProperty("name", OType.STRING);
    cl.createProperty("surname", OType.STRING);
    cl.createProperty("birthDate", OType.DATE);
    cl.createProperty("salary", OType.FLOAT);
  }
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.