Package com.googlecode.mjorm.query.criteria

Examples of com.googlecode.mjorm.query.criteria.Criterion


    DocumentCriterion criterion = null;
    String fieldName = null;
    switch (tree.getType()) {
      case MqlParser.DOCUMENT_FUNCTION_CRITERION:
        String functionName = child(tree, 0).getChild(0).getText().trim().toLowerCase();
        Criterion c = createCriterion(tree, ctx);
        if (!DocumentCriterion.class.isInstance(c)) {
          throw new MqlException(
            "Document function '"+functionName+"' returned a Criterion other than a DocumentCriterion");
        }
        criterion = DocumentCriterion.class.cast(c);
View Full Code Here


          return new RegexCriterion(Pattern.class.cast(value));
        }
        return new SimpleCriterion(comparisonOperators.get(op), value);
       
      case MqlParser.NEGATED_CRITERION:
        Criterion c = createCriterion(child(tree, 0), ctx);
        if (!FieldCriterion.class.isInstance(c)) {
          throw new MqlException(
            "NOT requires FieldCriteiron");
        }
        return new NotCriterion(FieldCriterion.class.cast(c));
View Full Code Here

    CommonTree tree, Map<String, MqlCriterionFunction> functionTable, ExecutionContext ctx) {
    assertTokenType(tree, MqlParser.FUNCTION_CALL);

    // get the function name
    String functionName = child(tree, 0).getText().trim().toLowerCase();
    Criterion ret = null;

    // function not found
    if (!functionTable.containsKey(functionName)) {
      throw new MqlException(
        "Unknown function: "+functionName);
View Full Code Here

TOP

Related Classes of com.googlecode.mjorm.query.criteria.Criterion

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.