Package org.teiid.query.sql.lang

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


    if ( updateCommands.size() > 0 ) {
        List<List<Integer>> filteredTuples = new ArrayList<List<Integer>>();
      for ( int c = 0; c < updateCommands.size(); c++ ) {
        Command cmd = updateCommands.get(c);
        if (cmd instanceof TranslatableProcedureContainer) {
          TranslatableProcedureContainer update = (TranslatableProcedureContainer)cmd;
          if ( update.getCriteria() != null ) {
              // Build lookupMap from BOTH all the elements and the projected symbols - both may be needed here
                  Map<Object, Integer> lookupMap = new HashMap<Object, Integer>();
                  for(int i=0; i<elements.size(); i++) {
                      Object element = elements.get(i);
                        mapElementToIndex(lookupMap, element, new Integer(i), group);       
                  }
                  for(int i=0; i<projectedSymbols.size(); i++) {
                    Object element = projectedSymbols.get(i);
                        mapElementToIndex(lookupMap, element, new Integer(columnMap[i]), group);
                  }
             
              int updated = 0;
              for(int i=0; i<tuples.length; i++) {
                      try {
                  if(new Evaluator(lookupMap, null, null).evaluate(update.getCriteria(), tuples[i])) {
                              updated++;
                          }
                      } catch(ExpressionEvaluationException e) {
                          throw new TeiidComponentException(e, e.getMessage());
                      }
View Full Code Here

TOP

Related Classes of org.teiid.query.sql.lang.TranslatableProcedureContainer

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.