Package org.teiid.query.validator

Examples of org.teiid.query.validator.ValidatorReport


    }
    context.setMetadata(metadata);
        try {
      QueryResolver.resolveCommand(command, metadata);
       
      ValidatorReport repo  = Validator.validate(command, metadata);
          Collection failures = new ArrayList();
          repo.collectInvalidObjects(failures);
          if (failures.size() > 0){
              fail("Exception during validation (" + repo); //$NON-NLS-1$
          }       
      command = QueryRewriter.rewrite(command, metadata, context);
          ProcessorPlan process = QueryOptimizer.optimizePlan(command, metadata, null, capFinder, analysisRecord, context);
View Full Code Here


          gs.setMetadataID(new TempMetadataID("proc", Collections.EMPTY_LIST));
          ((CreateUpdateProcedureCommand)userCommand).setVirtualGroup(gs);
        }
       
        QueryResolver.resolveCommand(userCommand, metadata);
    ValidatorReport report = Validator.validate(userCommand, metadata);
       
        if (report.hasItems()) {
            ValidatorFailure firstFailure = report.getItems().iterator().next();
            throw new QueryValidatorException(firstFailure.getMessage());
        }
        userCommand = QueryRewriter.rewrite(userCommand, metadata, null);
       
        AnalysisRecord analysisRecord = new AnalysisRecord(false, DEBUG);
View Full Code Here

    } else {
       command = QueryParser.getQueryParser().parseCommand(sql);
      QueryResolver.resolveCommand(command, md);
    }
   
        ValidatorReport repo = Validator.validate(command, md);

        Collection failures = new ArrayList();
        repo.collectInvalidObjects(failures);
        if (failures.size() > 0){
            fail("Exception during validation (" + repo); //$NON-NLS-1$
        }
       
    // rewrite
View Full Code Here

        HashMap<String, DataPolicy> policies = new HashMap<String, DataPolicy>();
        policies.put(policy.getName(), policy);
       
        AuthorizationValidationVisitor visitor = new AuthorizationValidationVisitor(policies, "test"); //$NON-NLS-1$
        visitor.setAllowFunctionCallsByDefault(false);
        ValidatorReport report = Validator.validate(command, metadata, visitor);
        if(report.hasItems()) {
            ValidatorFailure firstFailure = report.getItems().iterator().next();
           
            // strings
            Set<String> expected = new HashSet<String>(Arrays.asList(expectedInaccesible));
            // elements
            Set<String> actual = new HashSet<String>();
View Full Code Here

    }
   
    public static ProcessorPlan getProcedurePlan(String userQuery, QueryMetadataInterface metadata, CapabilitiesFinder capabilitiesFinder) throws Exception {
        Command userCommand = QueryParser.getQueryParser().parseCommand(userQuery);
        QueryResolver.resolveCommand(userCommand, metadata);
        ValidatorReport report = Validator.validate(userCommand, metadata);
       
        if (report.hasItems()) {
            ValidatorFailure firstFailure = report.getItems().iterator().next();
            throw new QueryValidatorException(firstFailure.getMessage());
        }
        QueryRewriter.rewrite(userCommand, metadata, new CommandContext());

        AnalysisRecord analysisRecord = new AnalysisRecord(false, DEBUG);
View Full Code Here

        QueryMetadataInterface metadata,
        Command command)
        throws QueryValidatorException, TeiidComponentException {

        // Validate with visitor
        ValidatorReport report = Validator.validate(command, metadata, visitor);
        if (report.hasItems()) {
            ValidatorFailure firstFailure = report.getItems().iterator().next();
            throw new QueryValidatorException(firstFailure.getMessage());
        }
    }
View Full Code Here

        if(DEBUG) System.out.println("\n####################################\n" + sql)//$NON-NLS-1$
        List<Command> commands = new ArrayList<Command>(sql.length);
        for (int i = 0; i < sql.length; i++) {
            Command command = QueryParser.getQueryParser().parseCommand(sql[i]);
            QueryResolver.resolveCommand(command, md);
            ValidatorReport repo =  Validator.validate(command, md);
            Collection failures = new ArrayList();
            repo.collectInvalidObjects(failures);
            if (failures.size() > 0){
                fail("Exception during validation (" + repo); //$NON-NLS-1$
            }                   
           
            command = QueryRewriter.rewrite(command, md, null);
View Full Code Here

TOP

Related Classes of org.teiid.query.validator.ValidatorReport

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.