Package org.teiid.api.exception.query

Examples of org.teiid.api.exception.query.FunctionExecutionException


        }
       
        try {
            return eval.hasRole(SecurityFunctionEvaluator.DATA_ROLE, (String)roleName);
        } catch (TeiidComponentException err) {
            throw new FunctionExecutionException(err, err.getMessage());
        }
    }
View Full Code Here


        }
       
        try {
            return eval.hasRole((String)roleType, (String)roleName);
        } catch (TeiidComponentException err) {
            throw new FunctionExecutionException(err, err.getMessage());
        }
    }
View Full Code Here

                if(valueComp.compareTo(minValue) < 0) {
                    minValue = valueComp;
                }
            } else {
                throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MIN", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            }
        }
    }
View Full Code Here

                if(valueComp.compareTo(maxValue) > 0) {
                    maxValue = valueComp;
                }
            } else {
                throw new FunctionExecutionException("ERR.015.001.0050", QueryPlugin.Util.getString("ERR.015.001.0050", "MAX", value.getClass().getName())); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            }
        }
    }
View Full Code Here

            case BIG_DECIMAL:
                try {
                    return ((BigDecimal)sum).divide(new BigDecimal(count), AVG_SCALE, BigDecimal.ROUND_HALF_UP);
                } catch(ArithmeticException e) {
                    throw new FunctionExecutionException(e, "ERR.015.001.0048", QueryPlugin.Util.getString("ERR.015.001.0048", sum, new Integer(count))); //$NON-NLS-1$ //$NON-NLS-2$
                }
            default:
                throw new AssertionError("unknown accumulator type"); //$NON-NLS-1$

        }
View Full Code Here

          array = ((java.sql.Array)array).getArray();
        } catch (SQLException e) {
          throw new TeiidProcessingException(e);
        }
      } else {
        throw new FunctionExecutionException(QueryPlugin.Util.getString("FunctionMethods.not_array_value", array.getClass())); //$NON-NLS-1$
      }
    }
   
    for (int output : projectionIndexes) {
      ProjectedColumn col = table.getColumns().get(output);
      try {
        Object val = Array.get(array, output);
        tuple.add(DataTypeManager.transformValue(val, table.getColumns().get(output).getSymbol().getType()));
      } catch (TransformationException e) {
        throw new TeiidProcessingException(e, QueryPlugin.Util.getString("ArrayTableNode.conversion_error", col.getName())); //$NON-NLS-1$
      } catch (ArrayIndexOutOfBoundsException e) {
        throw new FunctionExecutionException(QueryPlugin.Util.getString("FunctionMethods.array_index", output + 1)); //$NON-NLS-1$
      }
    }
    addBatchRow(tuple);
    terminateBatches();
    return pullBatch();
View Full Code Here

    Result result = null;
    try {
      result = evaluateXQuery(xmlQuery.getXQueryExpression(), xmlQuery.getPassing(), tuple);
      return xmlQuery.getXQueryExpression().createXMLType(result.iter, this.context.getBufferManager(), emptyOnEmpty);
    } catch (TeiidProcessingException e) {
      throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
    } catch (XPathException e) {
      throw new FunctionExecutionException(e, QueryPlugin.Util.getString("Evaluator.xmlquery", e.getMessage())); //$NON-NLS-1$
    } finally {
      if (result != null) {
        result.close();
      }
    }
View Full Code Here

      }
      if (value.getType() == Type.DOCUMENT || value.getType() == Type.ELEMENT) {
        return serialize(xs, value);
      }
    } catch (SQLException e) {
      throw new FunctionExecutionException(e, e.getMessage());
    } catch (TransformationException e) {
      throw new FunctionExecutionException(e, e.getMessage());
    }
    throw new FunctionExecutionException(QueryPlugin.Util.getString("Evaluator.xmlserialize")); //$NON-NLS-1$
  }
View Full Code Here

    Evaluator.NameValuePair<Object>[] nameValuePairs = getNameValuePairs(tuple, args, true);
     
    try {
      return XMLSystemFunctions.xmlForest(context, namespaces(function.getNamespaces()), nameValuePairs);
    } catch (TeiidProcessingException e) {
      throw new FunctionExecutionException(e, e.getMessage());
    }
  }
View Full Code Here

         if (function.getAttributes() != null) {
           attributes = getNameValuePairs(tuple, function.getAttributes().getArgs(), true);
         }
         return XMLSystemFunctions.xmlElement(context, function.getName(), namespaces(function.getNamespaces()), attributes, values);
       } catch (TeiidProcessingException e) {
         throw new FunctionExecutionException(e, e.getMessage());
       }
  }
View Full Code Here

TOP

Related Classes of org.teiid.api.exception.query.FunctionExecutionException

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.