Package org.teiid.core

Examples of org.teiid.core.TeiidComponentException


    throw new UnsupportedOperationException("Subquery evaluation not possible with a base Evaluator"); //$NON-NLS-1$
  }

  private CommandContext getContext(LanguageObject expression) throws TeiidComponentException {
    if (context == null) {
      throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
    return context;
  }  
View Full Code Here


      return null;
    }
   
    private void checkStatus() throws TeiidComponentException {
      if (stopped) {
        throw new TeiidComponentException(QueryPlugin.Util.getString("ConnectorManager.not_in_valid_state", this.translatorName)); //$NON-NLS-1$
      }
    }
View Full Code Here

              }
            }         
        }

        if (exception != null) {
          throw new TeiidComponentException(exception);
        }
       
        if (caps == null) {
          throw new TeiidRuntimeException("No sources were given for the model " + modelName); //$NON-NLS-1$
        }
View Full Code Here

    this.batchSize = batchSize;
  }
     
    public Streamable<?> getLobReference(String id) throws TeiidComponentException {
      if (lobManager == null) {
        throw new TeiidComponentException(QueryPlugin.Util.getString("ProcessWorker.wrongdata")); //$NON-NLS-1$
      }
      return lobManager.getLobReference(id);
    }
View Full Code Here

    this.variableContext = toPush;
  }
 
  public Object getFromContext(Expression expression) throws TeiidComponentException {
    if (variableContext == null || !(expression instanceof ElementSymbol)) {
      throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
    Object value = variableContext.getValue((ElementSymbol)expression);
    if (value == null && !variableContext.containsVariable((ElementSymbol)expression)) {
      throw new TeiidComponentException("ERR.015.006.0033", QueryPlugin.Util.getString("ERR.015.006.0033", expression, "No value was available")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    }
    return value;
  }
View Full Code Here

                  try {
              if(new Evaluator(lookupMap, null, null).evaluate(query.getCriteria(), tuples[i])) {
                          filteredTuples.add(tuples[i]);
                      }
                  } catch(ExpressionEvaluationException e) {
                      throw new TeiidComponentException(e, e.getMessage());
                  }
          }
         
          tuples = new List[filteredTuples.size()];
          filteredTuples.toArray(tuples);
      }
    } else if ( command instanceof Insert || command instanceof Update || command instanceof Delete) {
      // add single update command to a list to be executed
      updateCommands.add(command);
    } else if ( command instanceof BatchedUpdateCommand ) {
      // add all update commands to a list to be executed
        updateCommands.addAll(((BatchedUpdateCommand) command).getUpdateCommands());
    }
   
    // if we had update commands added to the list, execute them now
    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());
                      }
              }
              List<Integer> updateTuple = new ArrayList<Integer>(1);
              updateTuple.add( new Integer(updated) );
                      filteredTuples.add(updateTuple);
View Full Code Here

    private GroupSymbol getQueryGroup(Query query) throws TeiidComponentException {
        GroupSymbol group;
        From from = query.getFrom();
        List groups = from.getGroups();
        if(groups.size() != 1) {
          throw new TeiidComponentException("Cannot build fake tuple source for command: " + query);   //$NON-NLS-1$
        }
        group = (GroupSymbol) groups.get(0);
        Iterator projSymbols = query.getSelect().getProjectedSymbols().iterator();
        while (projSymbols.hasNext()) {
            Object symbol = projSymbols.next();
            if (symbol instanceof ElementSymbol){
                ElementSymbol elementSymbol = (ElementSymbol)symbol;
                GroupSymbol g = elementSymbol.getGroupSymbol();
                if (!g.equals(group)){
                    throw new TeiidComponentException("Illegal symbol " + elementSymbol + " in SELECT of command: " + query);    //$NON-NLS-1$ //$NON-NLS-2$
                }
                if (elementSymbol.getMetadataID() == null){
                    throw new TeiidComponentException("Illegal null metadata ID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query);    //$NON-NLS-1$ //$NON-NLS-2$
                } else if (elementSymbol.getMetadataID() instanceof TempMetadataID){
                    throw new TeiidComponentException("Illegal TempMetadataID in ElementSymbol " + elementSymbol + " in SELECT of command: " + query);    //$NON-NLS-1$ //$NON-NLS-2$
                }
            }
        }
        return group;
    }
View Full Code Here

        Object keyValue)
        throws BlockedException, TeiidComponentException {
           
            String tableKey = codeTableName.toUpperCase() + keyElementName.toUpperCase() + returnElementName.toUpperCase();
            if(! codeTableValues.containsKey(tableKey)) {
                throw new TeiidComponentException("Unknown code table: " + codeTableName); //$NON-NLS-1$
            }
       
            if(throwBlocked) {
                if(blockedState.get(tableKey).equals(Boolean.FALSE)) {
                    blockedState.put(tableKey, Boolean.TRUE);
View Full Code Here

TOP

Related Classes of org.teiid.core.TeiidComponentException

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.