Package com.orientechnologies.orient.core.collate

Examples of com.orientechnologies.orient.core.collate.OCollate


      final List<OType> types, List<OCollate> collates) {
    final String className = oClass.getName();
    final OCompositeIndexDefinition compositeIndex = new OCompositeIndexDefinition(className);

    for (int i = 0, fieldsToIndexSize = fieldsToIndex.size(); i < fieldsToIndexSize; i++) {
      OCollate collate = null;
      if (collates != null)
        collate = collates.get(i);

      compositeIndex.addIndex(createSingleFieldIndexDefinition(oClass, fieldsToIndex.get(i), types.get(i), collate));
    }
View Full Code Here


        if (collates != null) {
          collatesList = new ArrayList<OCollate>();

          for (String collate : collates) {
            if (collate != null) {
              final OCollate col = OSQLEngine.getCollate(collate);
              collatesList.add(col);
            } else
              collatesList.add(null);
          }
        }
View Full Code Here

      final int size = Math.min(keys.size(), collates.size());
      for (int i = 0; i < size; i++) {
        final Object key = keys.get(i);

        final OCollate collate = collates.get(i);
        transformedKey.addKey(collate.transform(key));
      }

      for (int i = size; i < keys.size(); i++)
        transformedKey.addKey(keys.get(i));
View Full Code Here

      right = ((OSQLQuery<?>) right).setContext(iContext).execute();

    Object l = evaluate(iCurrentRecord, iCurrentResult, left, iContext);
    Object r = evaluate(iCurrentRecord, iCurrentResult, right, iContext);

    final OCollate collate = getCollate();

    final Object[] convertedValues = checkForConversion(iCurrentRecord, l, r, collate);
    if (convertedValues != null) {
      l = convertedValues[0];
      r = convertedValues[1];
View Full Code Here

  }

  public static OCollate getCollate(final String name) {
    for (Iterator<OCollateFactory> iter = getCollateFactories(); iter.hasNext();) {
      OCollateFactory f = iter.next();
      final OCollate c = f.getCollate(name);
      if (c != null)
        return c;
    }
    return null;
  }
View Full Code Here

        // ALL VALUES
        for (int i = 0; i < left.getValues().length; ++i) {
          Object v = left.getValues()[i];
          Object r = iRight;

          final OCollate collate = left.getCollate(i);
          if (collate != null) {
            v = collate.transform(v);
            r = collate.transform(iRight);
          }

          if (v == null || !evaluateExpression(iRecord, iCondition, v, r, iContext))
            return false;
        }
        return true;
      } else {
        // ANY VALUES
        for (int i = 0; i < left.getValues().length; ++i) {
          Object v = left.getValues()[i];
          Object r = iRight;

          final OCollate collate = left.getCollate(i);
          if (collate != null) {
            v = collate.transform(v);
            r = collate.transform(iRight);
          }

          if (v != null && evaluateExpression(iRecord, iCondition, v, r, iContext))
            return true;
        }
        return false;
      }

    } else if (iRight instanceof OQueryRuntimeValueMulti) {
      // RIGHT = MULTI
      final OQueryRuntimeValueMulti right = (OQueryRuntimeValueMulti) iRight;

      if (right.getValues().length == 0)
        return false;

      if (right.getDefinition().getRoot().startsWith(OSQLFilterItemFieldAll.NAME)) {
        // ALL VALUES
        for (int i = 0; i < right.getValues().length; ++i) {
          Object v = right.getValues()[i];
          Object l = iLeft;

          final OCollate collate = right.getCollate(i);
          if (collate != null) {
            v = collate.transform(v);
            l = collate.transform(iLeft);
          }

          if (v == null || !evaluateExpression(iRecord, iCondition, l, v, iContext))
            return false;
        }
        return true;
      } else {
        // ANY VALUES
        for (int i = 0; i < right.getValues().length; ++i) {
          Object v = right.getValues()[i];
          Object l = iLeft;

          final OCollate collate = right.getCollate(i);
          if (collate != null) {
            v = collate.transform(v);
            l = collate.transform(iLeft);
          }

          if (v != null && evaluateExpression(iRecord, iCondition, l, v, iContext))
            return true;
        }
View Full Code Here

  private OProperty setCollateInternal(String iCollate) {
    acquireSchemaWriteLock();
    try {
      checkEmbedded();

      final OCollate oldCollate = this.collate;

      if (iCollate == null)
        iCollate = ODefaultCollate.NAME;

      collate = OSQLEngine.getCollate(iCollate);
View Full Code Here

TOP

Related Classes of com.orientechnologies.orient.core.collate.OCollate

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.