/**
   * Bless a qualifier.<br>
   * Compund qualifier should traverse their child qualifier hierarchy and attempt to bless the leaf
   * qualifiers using the provided condition.<br>
   *
   * @param qualifier the qualifier to bless
   * @param condition the condition to apply to the qualifier
   * @param context the current context. May be modified by this method
   * @return true if the qualifier matches the condition
   */
  public boolean bless(EOQualifier qualifier, Condition condition, BlessingContext localContext) {
    EOKeyValueQualifier keyValueQualifier = (EOKeyValueQualifier) qualifier;

    return condition.evaluate(
        keyValueQualifier.key(),
        keyValueQualifier.value(),
        keyValueQualifier.selector(),
        localContext);
  }
예제 #2
0
 // ENHANCEME: This should support restrictive qualifiers on the root entity
 @Override
 public EOQualifier schemaBasedQualifierWithRootEntity(
     EOQualifier eoqualifier, EOEntity eoentity) {
   EOQualifier result = null;
   EOKeyValueQualifier qualifier = (EOKeyValueQualifier) eoqualifier;
   String key = qualifier.key();
   if (qualifier.selector().name().equals(MatchesAllInArraySelectorName)) {
     EOQualifierSQLGeneration.Support support =
         EOQualifierSQLGeneration.Support.supportForClass(ERXToManyQualifier.class);
     NSArray array = (NSArray) qualifier.value();
     ERXToManyQualifier q = new ERXToManyQualifier(key, array, array.count());
     result = support.schemaBasedQualifierWithRootEntity(q, eoentity);
     return result;
   }
   return (EOQualifier) eoqualifier.clone();
 }