Examples of BatchedUpdateCommand


Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        this.context.getVariableContext().setGlobalValue(this.prepPlan.getReferences().get(i).getContextSymbol(), c);
      }
      return;
    }
   
    BatchedUpdateCommand buc = new BatchedUpdateCommand(commands);
    buc.setVariableContexts(contexts);
    BatchedUpdatePlanner planner = new BatchedUpdatePlanner();
    this.processPlan = planner.optimize(buc, idGenerator, metadata, capabilitiesFinder, analysisRecord, context);
  }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        List<Command> parsedCommands = new ArrayList<Command>(commands.length);
        for (int i = 0; i < commands.length; i++) {
          String updateCommand = commands[i];
            parsedCommands.add(QueryParser.getQueryParser().parseCommand(updateCommand, parseInfo));
        }
        return new BatchedUpdateCommand(parsedCommands);
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        }
        return commands;
    }
   
    private BatchedUpdateCommand helpGetCommand(String[] sql, QueryMetadataInterface md) throws TeiidComponentException, TeiidProcessingException {
        BatchedUpdateCommand command = new BatchedUpdateCommand(helpGetCommands(sql, md));
        return command;
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

 
  @Test public void testDeleteUnion() throws Exception {
    String userSql = "delete from vm1.gx where e4 is null"; //$NON-NLS-1$
      String viewSql = "select * from pm1.g1 where e3 < 5 union all select * from pm1.g2 where e1 > 1";
        String expectedSql = "BatchedUpdate{D,D}";
        BatchedUpdateCommand buc = (BatchedUpdateCommand)helpTest(userSql, viewSql, expectedSql, null);
        assertEquals("DELETE FROM pm1.g2 WHERE (pm1.g2.e4 IS NULL) AND (e1 > '1')", buc.getUpdateCommands().get(1).toString());
  }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

            SetQuery union = (SetQuery) command;           
            group = getQueryGroup(union.getProjectedQuery());
    } else if (command instanceof ProcedureContainer) {
      group = ((ProcedureContainer) command).getGroup();
    } else if ( command instanceof BatchedUpdateCommand ) {
      BatchedUpdateCommand buc = (BatchedUpdateCommand)command;
        if ( buc.getUpdateCommands().get(0) instanceof Update ) {
          group = ((Update)buc.getUpdateCommands().get(0)).getGroup();
        }
        if (this.recordingCommands) {
              for ( Iterator<Command> it = ((BatchedUpdateCommand) command).getUpdateCommands().iterator(); it.hasNext(); ) {
                this.queries.add(it.next().toString());
              }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

            Arrays.asList(new Object[] { new Integer(1) }),
        };
       
        helpProcess(plan, dataManager, expected);
       
        BatchedUpdateCommand buc = (BatchedUpdateCommand)dataManager.getCommandHistory().iterator().next();
        Insert insert = (Insert)buc.getUpdateCommands().get(0);
               
        Constant value0 = (Constant)insert.getValues().get(0);
        Constant value1 = (Constant)insert.getValues().get(1);
       
        assertEquals(DataTypeManager.DefaultDataClasses.BIG_INTEGER, value0.getValue().getClass());
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        helpProcess(plan, dataManager, expected);
       
        // if not doBulkInsert and is doBatching,
        //    check the command hist to ensure it contains the expected commands
        if ( !doBulkInsert && doBatching ) {
            BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
            assertEquals(2, bu.getUpdateCommands().size());
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() )//$NON-NLS-1$
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() )//$NON-NLS-1$
        }       
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        helpProcess(plan, dataManager, expected);
       
        // if not doBulkInsert and is doBatching,
        //    check the command hist to ensure it contains the expected commands
        if ( cap == Capability.BATCHED_UPDATES ) {
            BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(1);
            assertEquals(2, bu.getUpdateCommands().size());
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() )//$NON-NLS-1$
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() )//$NON-NLS-1$
        }       
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        helpProcess(plan, dataManager, expected);
       
        // if not doBulkInsert and is doBatching,
        //    check the command hist to ensure it contains the expected commands
        if ( !doBulkInsert && doBatching ) {
            BatchedUpdateCommand bu = (BatchedUpdateCommand)new ArrayList(dataManager.getCommandHistory()).get(2);
            assertEquals(2, bu.getUpdateCommands().size());
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('1', 1, FALSE, 1.0)", bu.getUpdateCommands().get(0).toString() )//$NON-NLS-1$
            assertEquals( "INSERT INTO pm1.g2 (pm1.g2.e1, pm1.g2.e2, pm1.g2.e3, pm1.g2.e4) VALUES ('2', 2, TRUE, 2.0)", bu.getUpdateCommands().get(1).toString() )//$NON-NLS-1$
        }       
    }
View Full Code Here

Examples of org.teiid.query.sql.lang.BatchedUpdateCommand

        Set groups = new HashSet();
        groups.add(g1);
        groups.add(g2);
        groups.add(g3);
       
        helpTestGroups(new BatchedUpdateCommand(updates), true, groups);
    }
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.