Examples of OClass


Examples of com.orientechnologies.orient.core.metadata.schema.OClass

      record = database.newInstance();
      database.declareIntent(new OIntentMassiveInsert());
      database.begin(TXTYPE.NOTX);

      synchronized (this) {
        OClass c = database.getMetadata().getSchema().getClass("Account");
        if (c == null)
          c = database.getMetadata().getSchema().createClass("Account");

        OProperty p = database.getMetadata().getSchema().getClass("Account").getProperty("id");
        if (p == null)
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

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

    final OClass mapPointClass = database.getMetadata().getSchema().createClass("MapPoint");
    mapPointClass.createProperty("x", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);
    mapPointClass.createProperty("y", OType.DOUBLE).createIndex(INDEX_TYPE.NOTUNIQUE);

    final OPropertyIndex xIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("x").getIndex();
    Assert.assertNotNull(xIndex);

    final OPropertyIndex yIndex = database.getMetadata().getSchema().getClass("MapPoint").getProperty("y").getIndex();
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

      final String className = parts[0];
      if (className == null)
        throw new OCommandExecutionException("Class " + className + " not found");
      String fieldName = parts[1];

      final OClass cls = database.getMetadata().getSchema().getClass(className);
      if (cls == null)
        throw new OCommandExecutionException("Class '" + className + "' not found");

      final OPropertyImpl prop = (OPropertyImpl) cls.getProperty(fieldName);
      if (prop == null)
        throw new IllegalArgumentException("Property '" + fieldName + "' was not found in class '" + cls + "'");

      idx = prop.createIndexInternal(indexType.toUpperCase(), progressListener).getUnderlying();
    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

  }

  @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);
    database.getMetadata().getSchema().save();

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

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

      request.getResultListener().result(iRecord);
  }

  private void searchInClasses() {
    final int[] clusterIds;
    final OClass cls = compiledFilter.getTargetClasses().keySet().iterator().next();

    database.checkSecurity(ODatabaseSecurityResources.CLASS, ORole.PERMISSION_READ, cls.getName());

    clusterIds = cls.getPolymorphicClusterIds();

    // CHECK PERMISSION TO ACCESS TO ALL THE CONFIGURED CLUSTERS
    for (int clusterId : clusterIds)
      database.checkSecurity(ODatabaseSecurityResources.CLUSTER, ORole.PERMISSION_READ, database.getClusterNameById(clusterId),
          clusterId);
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

    }
  }

  public boolean evaluate(final ODatabaseRecord iDatabase, final ORecordSchemaAware<?> iRecord) {
    if (targetClasses != null) {
      final OClass cls = targetClasses.keySet().iterator().next();
      // CHECK IF IT'S PART OF THE REQUESTED CLASS
      if (iRecord.getSchemaClass() == null || !iRecord.getSchemaClass().isSubClassOf(cls))
        // EXCLUDE IT
        return false;
    }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

          // REGISTER AS CLASS
          if (targetClasses == null)
            targetClasses = new HashMap<OClass, String>();

          OClass cls = database.getMetadata().getSchema().getClass(subjectName);
          if (cls == null)
            throw new OCommandExecutionException("Class '" + subjectName + "' was not found in current database");

          targetClasses.put(cls, alias);
        }
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

      final String className = parts[0];
      if (className == null)
        throw new OCommandExecutionException("Class " + className + " not found");
      String fieldName = parts[1];

      final OClass cls = database.getMetadata().getSchema().getClass(className);
      if (cls == null)
        throw new OCommandExecutionException("Class '" + className + "' not found");

      final OPropertyImpl prop = (OPropertyImpl) cls.getProperty(fieldName);
      if (prop == null)
        throw new IllegalArgumentException("Property '" + fieldName + "' was not found in class '" + cls + "'");

      prop.dropIndexInternal();
    } else {
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

    }

    OProperty prop;
    Object fieldValue;
    OType type;
    OClass linkedClass;
    OType linkedType;
    String fieldClassName;
    int i = 0;

    // MARSHALL ALL THE CONFIGURED FIELDS
View Full Code Here

Examples of com.orientechnologies.orient.core.metadata.schema.OClass

    return iValue != null ? iValue.getClass().getSimpleName() : null;
  }

  private OClass getLinkInfo(final ODatabaseComplex<?> iDatabase, final String iFieldClassName) {
    OClass linkedClass = iDatabase.getMetadata().getSchema().getClass(iFieldClassName);

    if (iDatabase.getDatabaseOwner() instanceof ODatabaseObject) {
      ODatabaseObject dbo = (ODatabaseObject) iDatabase.getDatabaseOwner();
      if (linkedClass == null) {
        Class<?> entityClass = dbo.getEntityManager().getEntityClass(iFieldClassName);
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.