Package org.apache.hadoop.hbase.hbql.mapping

Examples of org.apache.hadoop.hbase.hbql.mapping.MappingContext


    }

    public ExpressionTree parseAnnotationExpr(final HConnection connection,
                                              final Object recordObj,
                                              final String expr) throws HBqlException {
        final MappingContext mappingContext = getAnnotationMappingContext(connection, recordObj);
        return parseDescWhereExpr(expr, mappingContext);
    }
View Full Code Here


        final MappingContext mappingContext = getAnnotationMappingContext(connection, recordObj);
        return parseDescWhereExpr(expr, mappingContext);
    }

    public ExpressionTree parseReflectionExpr(final Object recordObj, final String expr) throws HBqlException {
        final MappingContext mappingContext = getReflectionMappingContext(recordObj);
        return parseDescWhereExpr(expr, mappingContext);
    }
View Full Code Here

    }

    private static boolean evaluateAnnotationExpression(final HConnection connection,
                                                        final Object recordObj,
                                                        final String expr) throws HBqlException {
        final MappingContext mappingContext = getAnnotationMappingContext(connection, recordObj);
        final ExpressionTree tree = parseDescWhereExpr(expr, mappingContext);
        return evaluateExpression(recordObj, tree);
    }
View Full Code Here

        final ExpressionTree tree = parseDescWhereExpr(expr, mappingContext);
        return evaluateExpression(recordObj, tree);
    }

    private static boolean evaluateReflectionExpression(final Object recordObj, final String expr) throws HBqlException {
        final MappingContext mappingContext = getReflectionMappingContext(recordObj);
        final ExpressionTree tree = parseDescWhereExpr(expr, mappingContext);
        return evaluateExpression(recordObj, tree);
    }
View Full Code Here

    }

    private static MappingContext getAnnotationMappingContext(final HConnection connection,
                                                              final Object obj) throws HBqlException {
        if (obj == null)
            return new MappingContext();
        else
            return getAnnotatedMapping(connection, obj).getMappingContext();
    }
View Full Code Here

            return getAnnotatedMapping(connection, obj).getMappingContext();
    }

    private static MappingContext getReflectionMappingContext(final Object obj) throws HBqlException {
        if (obj == null)
            return new MappingContext();
        else
            return getReflectionMapping(obj).getMappingContext();
    }
View Full Code Here

            final ExpressionTree expressionTree = parser.descWhereExpr();

            expressionTree.setEmbeddedMapping();

            if (expressionTree.getMappingContext() == null)
                expressionTree.setMappingContext((sc == null) ? new MappingContext() : sc);

            return expressionTree;
        }
        catch (RecognitionException e) {
            e.printStackTrace();
View Full Code Here

    private static boolean evaluateWhereValue(final String expr) {
        try {
            final WithArgs args = ParserUtil.parseWithClause(expr);
            System.out.println("Evaluating: " + args.asString());
            args.setMappingContext(new MappingContext());
            args.validateArgTypes();
            return true;
        }
        catch (HBqlException e) {
            e.printStackTrace();
View Full Code Here

        }
        else {
            // Grab the first object to derive the mapping
            final Object obj = objects.iterator().next();
            final ReflectionMapping mapping = ReflectionMapping.getReflectionMapping(obj);
            final MappingContext mappingContext = new MappingContext(mapping);
            expressionTree = ParserUtil.parseWhereExpression(this.getQuery(), mappingContext);
            this.applyParameters(expressionTree);
        }

        return expressionTree;
View Full Code Here

import java.util.List;

public class ReflectionResultAccessor extends ResultAccessor {

    public ReflectionResultAccessor(final Object object) {
        super(new MappingContext(ReflectionMapping.getReflectionMapping(object)));
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.hbql.mapping.MappingContext

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.