Package com.orientechnologies.orient.core.metadata.schema

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


      Assert.fail("Shouldn't throw exceptions");
    }
  }

  protected void checkNotExistsProperty(OClass iClass, String iPropertyName) {
    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNull(prop);
  }
View Full Code Here


    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNull(prop);
  }

  protected void checkProperty(OClass iClass, String iPropertyName, OType iType) {
    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNotNull(prop);
    Assert.assertEquals(prop.getType(), iType);
  }
View Full Code Here

    Assert.assertNotNull(prop);
    Assert.assertEquals(prop.getType(), iType);
  }

  protected void checkProperty(OClass iClass, String iPropertyName, OType iType, OClass iLinkedClass) {
    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNotNull(prop);
    Assert.assertEquals(prop.getType(), iType);
    Assert.assertEquals(prop.getLinkedClass(), iLinkedClass);
  }
View Full Code Here

    Assert.assertEquals(prop.getType(), iType);
    Assert.assertEquals(prop.getLinkedClass(), iLinkedClass);
  }

  protected void checkProperty(OClass iClass, String iPropertyName, OType iType, OType iLinkedType) {
    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNotNull(prop);
    Assert.assertEquals(prop.getType(), iType);
    Assert.assertEquals(prop.getLinkedType(), iLinkedType);
  }
View Full Code Here

    Assert.assertEquals(prop.getType(), iType);
    Assert.assertEquals(prop.getLinkedType(), iLinkedType);
  }

  protected void checkNoLinkedProperty(OClass iClass, String iPropertyName, OType iType) {
    OProperty prop = iClass.getProperty(iPropertyName);
    Assert.assertNotNull(prop);
    Assert.assertNull(prop.getLinkedType());
    Assert.assertNull(prop.getLinkedClass());
  }
View Full Code Here

  /**
   * Creates a required property.
   */
  protected OProperty createRequiredProperty(OClass oClass, String propertyName, OType oType) {
    OProperty property = oClass.createProperty(propertyName, oType);
    property.setMandatory(true);
    property.setNotNull(true);
    return property;
  }
View Full Code Here

  /**
   * Creates a required property with an automatic index.
   */
  protected OProperty createRequiredAutoIndexedProperty(OClass oClass, String propertyName, OType oType, boolean unique) {
    OProperty property = createRequiredProperty(oClass, propertyName, oType);
    String indexName = String.format("%s.%s", oClass.getName(), propertyName);
    oClass.createIndex(indexName, unique ? INDEX_TYPE.UNIQUE : INDEX_TYPE.NOTUNIQUE, propertyName);
    return property;
  }
View Full Code Here

 
 
  private void createNewIndexClass(ODatabaseRecordTx db){
    Logger.info("...creating INDEX CLASS...");
    OClass indexClass = db.getMetadata().getSchema().createClass(IndexDao.MODEL_NAME);
    OProperty keyProp = indexClass.createProperty("key", OType.STRING);
    keyProp.createIndex(INDEX_TYPE.UNIQUE);
    keyProp.setNotNull(true).setMandatory(true);
  }
View Full Code Here

          cmd.getContext().setParent(iContext);
          fieldValue = ODatabaseRecordThreadLocal.INSTANCE.get().command(cmd).execute();

          // CHECK FOR CONVERSIONS
          if (iDocument.getSchemaClass() != null) {
            final OProperty prop = iDocument.getSchemaClass().getProperty(fieldName);
            if (prop != null) {
              if (prop.getType() == OType.LINK) {
                if (OMultiValue.isMultiValue(fieldValue)) {
                  final int size = OMultiValue.getSize(fieldValue);
                  if (size == 1)
                    // GET THE FIRST ITEM AS UNIQUE LINK
                    fieldValue = OMultiValue.getFirstValue(fieldValue);
View Full Code Here

      final OType concreteType = document.fieldType(fieldName);
      OType fieldType = concreteType;

      OType linkedType = null;
      if (fieldType == null && clazz != null) {
        OProperty property = clazz.getProperty(fieldName);
        if (property != null) {
          fieldType = property.getType();
          linkedType = property.getLinkedType();
        }
      }

      Object fieldValue = document.field(fieldName, fieldType);
      Object newValue = fieldWalker.visitField(fieldType, linkedType, fieldValue);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.metadata.schema.OProperty

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.