Package org.teiid.api.exception.query

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


     * the number of rows returned from a mapping class.
     */
    public static Object rowlimit(Object expression)
        throws FunctionExecutionException {
   
        throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
    }   
View Full Code Here


     * the number of rows returned from a mapping class.
     */
    public static Object rowlimitexception(Object expression)
        throws FunctionExecutionException {
   
        throw new FunctionExecutionException("ERR.015.001.0035a", QueryPlugin.Util.getString("ERR.015.001.0035a")); //$NON-NLS-1$ //$NON-NLS-2$
    }     
View Full Code Here

    throws FunctionExecutionException {
    try {
            SimpleDateFormat sdf = new SimpleDateFormat(format);
            return sdf.format(date);
    } catch (IllegalArgumentException iae) {
      throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
        iae.getMessage()));
    }
  }
View Full Code Here

      throws FunctionExecutionException {
    DateFormat df = new SimpleDateFormat(format);
    try {
      return df.parse(date);
    } catch (ParseException e) {
      throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
          date, format));
    }
  }
View Full Code Here

  throws FunctionExecutionException {
    try {
          DecimalFormat df = new DecimalFormat(format);
          return df.format(number);
    } catch (IllegalArgumentException iae) {
      throw new FunctionExecutionException("ERR.015.001.0042", QueryPlugin.Util.getString("ERR.015.001.0042" , //$NON-NLS-1$ //$NON-NLS-2$
      iae.getMessage()));
    }
  }
View Full Code Here

    throws FunctionExecutionException {
    DecimalFormat df= new DecimalFormat(format);
    try {
      return df.parse(number);
    } catch (ParseException e) {
      throw new FunctionExecutionException("ERR.015.001.0043", QueryPlugin.Util.getString("ERR.015.001.0043" , //$NON-NLS-1$ //$NON-NLS-2$
          number,format));
    }
  }
View Full Code Here

      }
      if (array instanceof java.sql.Array) {
        return Array.get(((java.sql.Array)array).getArray(index, 1), 0);
      }
    } catch (ArrayIndexOutOfBoundsException e) {
      throw new FunctionExecutionException(QueryPlugin.Util.getString("FunctionMethods.array_index", index)); //$NON-NLS-1$
    }
    throw new FunctionExecutionException(QueryPlugin.Util.getString("FunctionMethods.not_array_value", array.getClass())); //$NON-NLS-1$
  }
View Full Code Here

      return Array.getLength(array);
    }
    if (array instanceof java.sql.Array) {
      return Array.getLength(((java.sql.Array)array).getArray());
    }
    throw new FunctionExecutionException(QueryPlugin.Util.getString("FunctionMethods.not_array_value", array.getClass())); //$NON-NLS-1$
  }
View Full Code Here

        // If descriptor is missing invokable method, find this VM's descriptor
        // give name and types from fd
        Method method = getInvocationMethod();
        if(method == null) {
          throw new FunctionExecutionException("ERR.015.001.0002", QueryPlugin.Util.getString("ERR.015.001.0002", getName())); //$NON-NLS-1$ //$NON-NLS-2$
        }
       
        if (getDeterministic().compareTo(Determinism.USER_DETERMINISTIC) <= 0 && values.length > 0 && values[0] instanceof CommandContext) {
          CommandContext cc = (CommandContext)values[0];
          cc.setDeterminismLevel(getDeterministic());
        }
       
        // Invoke the method and return the result
        try {
          if (method.isVarArgs()) {
            int i = method.getParameterTypes().length;
            Object[] newValues = Arrays.copyOf(values, i);
            newValues[i - 1] = Arrays.copyOfRange(values, i - 1, values.length);
            values = newValues;
          }
            Object result = method.invoke(null, values);
            return importValue(result, getReturnType());
        } catch(ArithmeticException e) {
        throw new FunctionExecutionException(e, "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
        } catch(InvocationTargetException e) {
            throw new FunctionExecutionException(e.getTargetException(), "ERR.015.001.0003", QueryPlugin.Util.getString("ERR.015.001.0003", getName())); //$NON-NLS-1$ //$NON-NLS-2$
        } catch(IllegalAccessException e) {
            throw new FunctionExecutionException(e, "ERR.015.001.0004", QueryPlugin.Util.getString("ERR.015.001.0004", method.toString())); //$NON-NLS-1$ //$NON-NLS-2$
        } catch (TransformationException 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.