Package com.orientechnologies.orient.core.index

Examples of com.orientechnologies.orient.core.index.OIndexDefinition.createValue()


       }

       final OIndexDefinition indexDefinition = index.getDefinition();
       final Object key;
       if (indexDefinition != null)
         key = indexDefinition.createValue(urlParts[3]);
       else
         key = urlParts[3];

       if (key == null)
         throw new IllegalArgumentException("Invalid key value : " + urlParts[3]);
View Full Code Here


    final OIndex<?> internalIndex = index.getInternal();

    OIndexCursor cursor;
    if (internalIndex instanceof OIndexFullText) {
      final Object key = indexDefinition.createValue(keyParams);
      final Object indexResult = index.get(key);

      if (indexResult == null || indexResult instanceof OIdentifiable)
        cursor = new OIndexCursorSingleValue((OIdentifiable) indexResult, key);
      else
View Full Code Here

    if (indexDefinition.getParamCount() == 1) {
      final Object key;
      if (indexDefinition instanceof OIndexDefinitionMultiValue)
        key = ((OIndexDefinitionMultiValue) indexDefinition).createSingleValue(keyParams.get(0));
      else
        key = indexDefinition.createValue(keyParams);

      if (key == null)
        return null;

      final Object indexResult;
View Full Code Here

  private Set<Comparable> prepareKeys(OIndex<?> index, Object keys) {
    final OIndexDefinition indexDefinition = index.getDefinition();
    if (keys instanceof Collection) {
      final Set<Comparable> newKeys = new TreeSet<Comparable>();
      for (Object o : ((Collection) keys)) {
        newKeys.add((Comparable) indexDefinition.createValue(o));
      }
      return newKeys;
    } else {
      return Collections.singleton((Comparable) indexDefinition.createValue(keys));
    }
View Full Code Here

      for (Object o : ((Collection) keys)) {
        newKeys.add((Comparable) indexDefinition.createValue(o));
      }
      return newKeys;
    } else {
      return Collections.singleton((Comparable) indexDefinition.createValue(keys));
    }
  }

  /**
   * Register statistic information about usage of index in {@link OProfiler}.
View Full Code Here

      final List<Object> inKeys = new ArrayList<Object>();

      boolean containsNotCompatibleKey = false;
      for (final Object keyValue : inParams) {
        final Object key = indexDefinition.createValue(OSQLHelper.getValue(keyValue));
        if (key == null) {
          containsNotCompatibleKey = true;
          break;
        }
View Full Code Here

    if (indexDefinition.getParamCount() == 1) {
      final Object key;
      if (indexDefinition instanceof OIndexDefinitionMultiValue)
        key = ((OIndexDefinitionMultiValue) indexDefinition).createSingleValue(keyParams.get(0));
      else
        key = indexDefinition.createValue(keyParams);

      if (key == null)
        return null;

      final Object indexResult;
View Full Code Here

    Assert.assertEquals(propOneIndex.getSize(), 1);

    final OIndex<?> compositeIndex = oClass.getClassIndex("classIndexManagerComposite");

    final OIndexDefinition compositeIndexDefinition = compositeIndex.getDefinition();
    Assert.assertNotNull(compositeIndex.get(compositeIndexDefinition.createValue("a", 1)));
    Assert.assertEquals(compositeIndex.getSize(), 1);

    final OIndex<?> propZeroIndex = oSuperClass.getClassIndex("classIndexManagerTestSuperClass.prop0");
    Assert.assertNotNull(propZeroIndex.get("x"));
    Assert.assertEquals(propZeroIndex.getSize(), 1);
View Full Code Here

    Assert.assertEquals(compositeIndex.getSize(), 1);
    Assert.assertEquals(propZeroIndex.getSize(), 1);

    Assert.assertNotNull(propZeroIndex.get("y"));
    Assert.assertNotNull(propOneIndex.get("a"));
    Assert.assertNotNull(compositeIndex.get(compositeIndexDefinition.createValue("a", 2)));
  }

  public void testUpdateDocumentIndexRecordUpdatedFromNullField() {
    final ODocument doc = new ODocument("classIndexManagerTestClass");
    doc.field("prop1", "a");
View Full Code Here

    Assert.assertEquals(propOneIndex.getSize(), 1);
    Assert.assertEquals(compositeIndex.getSize(), 1);

    Assert.assertNotNull(propOneIndex.get("a"));
    Assert.assertNotNull(compositeIndex.get(compositeIndexDefinition.createValue("a", 2)));
  }

  public void testListUpdate() {
    final OSchema schema = database.getMetadata().getSchema();
    final OClass oClass = schema.getClass("classIndexManagerTestClass");
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.