Examples of OProperty


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

    if (iCondition.getLeft() instanceof OSQLFilterItemField && iCondition.getRight() instanceof OSQLFilterItemField)
      return false;

    final OSQLFilterItemField item = (OSQLFilterItemField) iItem;

    OProperty prop = iSchemaClass.getProperty(item.getName());

    while ((prop == null || !prop.isIndexed()) && iSchemaClass.getSuperClass() != null) {
      iSchemaClass = iSchemaClass.getSuperClass();
      prop = iSchemaClass.getProperty(item.getName());
    }

    if (prop != null && prop.isIndexed()) {
      final Object origValue = iCondition.getLeft() == iItem ? iCondition.getRight() : iCondition.getLeft();
      final OIndex underlyingIndex = prop.getIndex().getUnderlying();

      if (iCondition.getOperator() instanceof OQueryOperatorBetween) {
        iSearchInIndexTriples.add(new OSearchInIndexTriple(iCondition.getOperator(), origValue, underlyingIndex));
        return true;
      }
View Full Code Here

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

      synchronized (LocalCreateDocumentMultiThreadIndexedSpeedTest.class) {
        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)
          p = database.getMetadata().getSchema().getClass("Account").createProperty("id", OType.INTEGER);

        if (!p.isIndexed())
          p.createIndex(INDEX_TYPE.NOTUNIQUE);
      }
    }
View Full Code Here

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

    if (iFieldValue.equals("null"))
      return null;

    if (iFieldName != null)
      if (iRecord.getSchemaClass() != null) {
        final OProperty p = iRecord.getSchemaClass().getProperty(iFieldName);
        if (p != null) {
          iType = p.getType();
          iLinkedType = p.getLinkedType();
        }
      }

    if (iFieldValue.startsWith("{") && iFieldValue.endsWith("}")) {
      // OBJECT OR MAP. CHECK THE TYPE ATTRIBUTE TO KNOW IT
View Full Code Here

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

      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, prop.getId());

    } finally {
      if (db != null)
        OSharedDocumentDatabase.release(db);
    }
View Full Code Here

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

    if (iType != null)
      setFieldType(iPropertyName, iType);
    else if (_clazz != null) {
      // SCHEMAFULL?
      final OProperty prop = _clazz.getProperty(iPropertyName);
      if (prop != null)
        iType = prop.getType();
    }

    if (iPropertyValue == null) {
      _fieldValues.put(iPropertyName, iPropertyValue);
    } else {
View Full Code Here

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

        continue;
      }

      OType fieldType = fieldType(fieldEntry.getKey());
      if (fieldType == null && _clazz != null) {
        final OProperty prop = _clazz.getProperty(fieldEntry.getKey());
        fieldType = prop != null ? prop.getType() : null;
      }

      if (fieldType == null
          || !(OType.EMBEDDEDLIST.equals(fieldType) || OType.EMBEDDEDMAP.equals(fieldType) || OType.EMBEDDEDSET.equals(fieldType)
              || OType.LINKSET.equals(fieldType) || OType.LINKLIST.equals(fieldType) || OType.LINKMAP.equals(fieldType)))
View Full Code Here

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

    } else
      fieldType = null;

    if (fieldType == null && _clazz != null) {
      // SCHEMAFULL?
      final OProperty prop = _clazz.getProperty(iFieldName);
      if (prop != null) {
        fieldType = prop.getType();
        if (fieldType != OType.ANY)
          setFieldType(iFieldName, fieldType);
      }
    }
    return fieldType;
View Full Code Here

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

      }

      if (total > 0) {
        if (inverse) {
          // REMOVE THE OLD PROPERTY IF ANY
          OProperty prop = destClass.getProperty(linkName);
          if (prop != null)
            destClass.dropProperty(linkName);

          if (linkType == null)
            linkType = multipleRelationship ? OType.LINKSET : OType.LINK;

          // CREATE THE PROPERTY
          destClass.createProperty(linkName, linkType, sourceClass);

        } else {

          // REMOVE THE OLD PROPERTY IF ANY
          OProperty prop = sourceClass.getProperty(linkName);
          if (prop != null)
            sourceClass.dropProperty(linkName);

          // CREATE THE PROPERTY
          sourceClass.createProperty(linkName, OType.LINK, destClass);
View Full Code Here

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

    for (int i = 0, fieldNamesSize = fieldNames.size(); i < fieldNamesSize; i++) {
      String fieldName = fieldNames.get(i);
      OType type = types.get(i);

      final OProperty property = oClass.getProperty(fieldName);
      if (property != null && !type.equals(property.getType())) {
        throw new IllegalArgumentException("Property type list not match with real property types");
      }
    }
  }
View Full Code Here

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

  private static OIndexDefinition createSingleFieldIndexDefinition(OClass oClass, final String field, final OType type,
      OCollate collate) {
    final String fieldName = adjustFieldName(oClass, extractFieldName(field));
    final OIndexDefinition indexDefinition;

    final OProperty propertyToIndex = oClass.getProperty(fieldName);
    final OType indexType;
    if (type == OType.EMBEDDEDMAP || type == OType.LINKMAP) {
      final OPropertyMapIndexDefinition.INDEX_BY indexBy = extractMapIndexSpecifier(field);

      if (indexBy.equals(OPropertyMapIndexDefinition.INDEX_BY.KEY))
        indexType = OType.STRING;
      else {
        if (type == OType.LINKMAP)
          indexType = OType.LINK;
        else {
          indexType = propertyToIndex.getLinkedType();
          if (indexType == null)
            throw new OIndexException("Linked type was not provided."
                + " You should provide linked type for embedded collections that are going to be indexed.");
        }

      }

      indexDefinition = new OPropertyMapIndexDefinition(oClass.getName(), fieldName, indexType, indexBy);
    } else if (type.equals(OType.EMBEDDEDLIST) || type.equals(OType.EMBEDDEDSET) || type.equals(OType.LINKLIST)
        || type.equals(OType.LINKSET)) {
      if (type.equals(OType.LINKSET))
        indexType = OType.LINK;
      else if (type.equals(OType.LINKLIST)) {
        indexType = OType.LINK;
      } else {
        indexType = propertyToIndex.getLinkedType();
        if (indexType == null)
          throw new OIndexException("Linked type was not provided."
              + " You should provide linked type for embedded collections that are going to be indexed.");
      }

      indexDefinition = new OPropertyListIndexDefinition(oClass.getName(), fieldName, indexType);
    } else if (type.equals(OType.LINKBAG)) {
      indexDefinition = new OPropertyRidBagIndexDefinition(oClass.getName(), fieldName);
    } else
      indexDefinition = new OPropertyIndexDefinition(oClass.getName(), fieldName, type);

    if (collate == null && propertyToIndex != null)
      collate = propertyToIndex.getCollate();

    if (collate != null)
      indexDefinition.setCollate(collate);

    return indexDefinition;
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.