Package org.teiid.query.sql.lang

Examples of org.teiid.query.sql.lang.Update.addChange()


    }
   
    @Test public void testUpdateWithOption() {
        Update update = new Update();    
        update.setGroup(new GroupSymbol("m.g")); //$NON-NLS-1$
        update.addChange(new ElementSymbol("a"), new Reference(0));
        Option option = new Option();
        option.setNoCache(true);
        Criteria crit = new CompareCriteria(new ElementSymbol("b"), CompareCriteria.EQ, new Reference(1)); //$NON-NLS-1$
        update.setCriteria(crit);
        TestParser.helpTest("UPDATE m.g SET a = ? WHERE b = ? OPTION NOCACHE"//$NON-NLS-1$
View Full Code Here


    @Test public void testShouldExecuteUpdate() throws Exception {
        Update update = new Update();
       
        update.setGroup(new GroupSymbol("test")); //$NON-NLS-1$
       
        update.addChange(new ElementSymbol("e1"), new Constant("1")); //$NON-NLS-1$ //$NON-NLS-2$
       
        assertTrue(RelationalNodeUtil.shouldExecute(update, false));
       
        update.setChangeList(new SetClauseList());
       
View Full Code Here

        from.addGroup(g);

        ElementSymbol e =  new ElementSymbol("foo"); //$NON-NLS-1$
        Update query = new Update();
        query.setGroup(g);
        query.addChange(e, new Constant("bar", String.class)); //$NON-NLS-1$
       
        helpTest("update x set \"foo\"='bar'"//$NON-NLS-1$
                 "UPDATE x SET foo = 'bar'"//$NON-NLS-1$
                 query);               
   
View Full Code Here

    }
 
  public void testUpdate1() {
    Update update = new Update();
    update.setGroup(new GroupSymbol("m.g1"));     //$NON-NLS-1$
    update.addChange(new ElementSymbol("e1"), new Constant("abc")); //$NON-NLS-1$ //$NON-NLS-2$
   
    helpTest(update, "UPDATE m.g1 SET e1 = 'abc'"); //$NON-NLS-1$
  }
 
  public void testUpdate2() {
View Full Code Here

  }
 
  public void testUpdate2() {
    Update update = new Update();
    update.setGroup(new GroupSymbol("m.g1"));     //$NON-NLS-1$
    update.addChange(new ElementSymbol("e1"), new Constant("abc")); //$NON-NLS-1$ //$NON-NLS-2$
    update.addChange(new ElementSymbol("e2"), new Constant("xyz")); //$NON-NLS-1$ //$NON-NLS-2$
   
    helpTest(update, "UPDATE m.g1 SET e1 = 'abc', e2 = 'xyz'"); //$NON-NLS-1$
  }
 
View Full Code Here

  }
 
  public void testVisitUpdate1() {
    Update update = new Update();
    update.setGroup(exampleGroup(true, 0));
    update.addChange(exampleElement(true, 0), new Constant("abc"));    //$NON-NLS-1$
    update.addChange(exampleElement(true, 1), new Constant("abc"));    //$NON-NLS-1$
    helpTest(update, getSymbolMap());
  }

  public void testVisitUpdate2() {
View Full Code Here

 
  public void testVisitUpdate1() {
    Update update = new Update();
    update.setGroup(exampleGroup(true, 0));
    update.addChange(exampleElement(true, 0), new Constant("abc"));    //$NON-NLS-1$
    update.addChange(exampleElement(true, 1), new Constant("abc"));    //$NON-NLS-1$
    helpTest(update, getSymbolMap());
  }

  public void testVisitUpdate2() {
    Update update = new Update();
View Full Code Here

  }

  public void testVisitUpdate2() {
    Update update = new Update();
    update.setGroup(exampleGroup(true, 0));
    update.addChange(exampleElement(true, 0), new Constant("abc"));    //$NON-NLS-1$
    update.addChange(exampleElement(true, 1), new Constant("abc"));    //$NON-NLS-1$
    update.setCriteria(new CompareCriteria(exampleElement(true, 2), CompareCriteria.LT, new Constant("xyz"))); //$NON-NLS-1$
    helpTest(update, getSymbolMap());
  }
View Full Code Here

  public void testVisitUpdate2() {
    Update update = new Update();
    update.setGroup(exampleGroup(true, 0));
    update.addChange(exampleElement(true, 0), new Constant("abc"));    //$NON-NLS-1$
    update.addChange(exampleElement(true, 1), new Constant("abc"));    //$NON-NLS-1$
    update.setCriteria(new CompareCriteria(exampleElement(true, 2), CompareCriteria.LT, new Constant("xyz"))); //$NON-NLS-1$
    helpTest(update, getSymbolMap());
  }

  public void testVisitAliasSymbol() {
View Full Code Here

 
  public void testUpdate2() {
    Update update = new Update();
    update.setGroup(new GroupSymbol("m.g1"));     //$NON-NLS-1$
    update.addChange(new ElementSymbol("e1"), new Constant("abc")); //$NON-NLS-1$ //$NON-NLS-2$
    update.addChange(new ElementSymbol("e2"), new Constant("xyz")); //$NON-NLS-1$ //$NON-NLS-2$
   
    helpTest(update, "UPDATE m.g1 SET e1 = 'abc', e2 = 'xyz'"); //$NON-NLS-1$
  }
 
  public void testUpdate3() {
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.