Package org.teiid.language

Examples of org.teiid.language.IteratorValueSource


  @Test public void testInsertIteratorUpdate() throws Exception {
    Insert command = (Insert)TranslationHelper.helpTranslate(TranslationHelper.BQT_VDB, "insert into BQT1.SmallA (IntKey, IntNum) values (1, 2)"); //$NON-NLS-1$
    List<List<Integer>> values = new ArrayList<List<Integer>>();
    values.add(Arrays.asList(1, 2));
    values.add(Arrays.asList(2, 3));
    command.setValueSource(new IteratorValueSource(values.iterator(), 2));
   
    Connection connection = Mockito.mock(Connection.class);
    PreparedStatement p = Mockito.mock(PreparedStatement.class);
    Mockito.stub(p.executeBatch()).toReturn(new int [] {1, 1});
    Mockito.stub(connection.prepareStatement("INSERT INTO SmallA (IntKey, IntNum) VALUES (?, ?)")).toReturn(p); //$NON-NLS-1$
View Full Code Here

TOP

Related Classes of org.teiid.language.IteratorValueSource

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.