Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.Command.clone()


        throw new RuntimeException(e);
    }

    assertEquals("Parse string does not match: ", expectedString, actualString); //$NON-NLS-1$
    assertEquals("Command objects do not match: ", expectedCommand, actualCommand);         //$NON-NLS-1$
    assertEquals("Cloned command objects do not match: ", expectedCommand, actualCommand.clone());         //$NON-NLS-1$
  }

  static void helpTestExpression(String sql, String expectedString, Expression expected) throws QueryParserException {
    Expression  actual = QueryParser.getQueryParser().parseExpression(sql);
    String actualString = actual.toString();
View Full Code Here


    Command c = (Command)metadata.getFromMetadataCache(metadataId, cacheString);
    if (c == null) {
      c = QueryResolver.expandCommand(container, metadata, analysisRecord);
      if (c != null) {
            Request.validateWithVisitor(new ValidationVisitor(), metadata, c);
            metadata.addToMetadataCache(metadataId, cacheString, c.clone());
      }
    } else {
      c = (Command)c.clone();
      if (c instanceof CreateUpdateProcedureCommand) {
        ((CreateUpdateProcedureCommand)c).setUserCommand(container);
View Full Code Here

      if (c != null) {
            Request.validateWithVisitor(new ValidationVisitor(), metadata, c);
            metadata.addToMetadataCache(metadataId, cacheString, c.clone());
      }
    } else {
      c = (Command)c.clone();
      if (c instanceof CreateUpdateProcedureCommand) {
        ((CreateUpdateProcedureCommand)c).setUserCommand(container);
      }
    }
    if (c != null) {
View Full Code Here

            }
          Request.validateWithVisitor(new ValidationVisitor(), qmi, result);
           
          validateProjectedSymbols(virtualGroup, qmi, result);
            cachedNode = new QueryNode(qnode.getQuery());
            cachedNode.setCommand((Command)result.clone());
         
      if(isView(virtualGroup, qmi)) {
            String updatePlan = qmi.getUpdatePlan(virtualGroup.getMetadataID());
        String deletePlan = qmi.getDeletePlan(virtualGroup.getMetadataID());
        String insertPlan = qmi.getInsertPlan(virtualGroup.getMetadataID());
View Full Code Here

                        aNode.setShouldEvaluateExpressions(EvaluatableVisitor.needsProcessingEvaluation(command));
                    }
                   
                    if (command instanceof QueryCommand) {
                      try {
                          command = (Command)command.clone();
                          boolean aliasGroups = modelID != null && CapabilitiesUtil.supportsGroupAliases(modelID, metadata, capFinder);
                          boolean aliasColumns = modelID != null && CapabilitiesUtil.supports(Capability.QUERY_SELECT_EXPRESSION, modelID, metadata, capFinder);
                          command.acceptVisitor(new AliasGenerator(aliasGroups, !aliasColumns));
                      } catch (QueryMetadataException err) {
                          throw new TeiidComponentException(err);
View Full Code Here

              context = context.clone();
              context.setVariableContext(this.contexts.get(i));
            }
            boolean needProcessing = false;
            if(shouldEvaluate != null && shouldEvaluate.get(i)) {
                updateCommand = (Command) updateCommand.clone();
                Evaluator eval = getEvaluator(Collections.emptyMap());
                eval.initialize(context, getDataManager());
                AccessNode.rewriteAndEvaluate(updateCommand, eval, context, context.getMetadata());
            }
            needProcessing = RelationalNodeUtil.shouldExecute(updateCommand, true);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.