private List<?> processRow() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { List<Object> tuple = new ArrayList<Object>(projectedColumns.size()); this.scriptContext.setAttribute(TEIID_ROW, this.item, ScriptContext.ENGINE_SCOPE); this.scriptContext.setAttribute(TEIID_ROW_NUMBER, this.rowCount, ScriptContext.ENGINE_SCOPE); for (ObjectColumn proColumn : projectedColumns) { Object value = evalScript(proColumn.getCompiledScript(), proColumn.getPath()); if (value == null) { if (proColumn.getDefaultExpression() != null) { tuple.add(getEvaluator(Collections.emptyMap()).evaluate(proColumn.getDefaultExpression(), null)); } else { tuple.add(null); } continue; } value = FunctionDescriptor.importValue(value, proColumn.getSymbol().getType(), getContext()); tuple.add(value); } item = null; return tuple; }
private List<?> processRow() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { List<Object> tuple = new ArrayList<Object>(projectedColumns.size()); this.scriptContext.setAttribute(TEIID_ROW, this.item, ScriptContext.ENGINE_SCOPE); this.scriptContext.setAttribute(TEIID_ROW_NUMBER, this.rowCount, ScriptContext.ENGINE_SCOPE); for (ObjectColumn proColumn : projectedColumns) { Object value = evalScript(proColumn.getCompiledScript(), proColumn.getPath()); if (value == null) { if (proColumn.getDefaultExpression() != null) { tuple.add(getEvaluator(Collections.emptyMap()).evaluate(proColumn.getDefaultExpression(), null)); } else { tuple.add(null); } continue; } value = FunctionDescriptor.importValue(value, proColumn.getSymbol().getType(), getContext()); tuple.add(value); } item = null; return tuple; }
private List<?> processRow() throws ExpressionEvaluationException, TeiidComponentException, TeiidProcessingException { List<Object> tuple = new ArrayList<Object>(projectedColumns.size()); this.scriptContext.setAttribute(TEIID_ROW, this.item, ScriptContext.ENGINE_SCOPE); this.scriptContext.setAttribute(TEIID_ROW_NUMBER, this.rowCount, ScriptContext.ENGINE_SCOPE); for (ObjectColumn proColumn : projectedColumns) { Object value = evalScript(proColumn.getCompiledScript(), proColumn.getPath()); if (value == null) { if (proColumn.getDefaultExpression() != null) { tuple.add(getEvaluator(Collections.emptyMap()).evaluate(proColumn.getDefaultExpression(), null)); } else { tuple.add(null); } continue; } value = FunctionDescriptor.importValue(value, proColumn.getSymbol().getType()); tuple.add(value); } item = null; return tuple; }
context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType(), context); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType()); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
context.setDeterminismLevel(getDeterministic()); return importValue(result, getReturnType(), context); } catch(ArithmeticException e) { throw new FunctionExecutionException(QueryPlugin.Event.TEIID30384, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30384, getFullName()));
public static Object getValue(Class<?> type, Item colItem, Configuration config, CommandContext context) throws XPathException, ValidationException, TransformationException { Object value = colItem; if (value instanceof AtomicValue) { value = getValue((AtomicValue)colItem, context); } else if (value instanceof Item) { Item i = (Item)value; if (XMLSystemFunctions.isNull(i)) { return null; } BuiltInAtomicType bat = typeMapping.get(type); if (bat != null) { AtomicValue av = new StringValue(i.getStringValueCS()); ConversionResult cr = Converter.convert(av, bat, config.getConversionRules()); value = cr.asAtomic(); value = getValue((AtomicValue)value, context); if (value instanceof Item) { value = ((Item)value).getStringValue(); } } else { value = i.getStringValue(); } } return FunctionDescriptor.importValue(value, type); }
public static Object getValue(Class<?> type, Item colItem, Configuration config, CommandContext context) throws XPathException, ValidationException, TransformationException { Object value = colItem; if (value instanceof AtomicValue) { value = getValue((AtomicValue)colItem, context); } else if (value instanceof Item) { Item i = (Item)value; if (XMLSystemFunctions.isNull(i)) { return null; } BuiltInAtomicType bat = typeMapping.get(type); if (bat != null) { AtomicValue av = new StringValue(i.getStringValueCS()); ConversionResult cr = Converter.convert(av, bat, config.getConversionRules()); value = cr.asAtomic(); value = getValue((AtomicValue)value, context); if (value instanceof Item) { value = ((Item)value).getStringValue(); } } else { value = i.getStringValue(); } } return FunctionDescriptor.importValue(value, type, context); }
public static Object getValue(Class<?> type, Item colItem, Configuration config, CommandContext context) throws XPathException, ValidationException, TransformationException { Object value = colItem; if (value instanceof AtomicValue) { value = getValue((AtomicValue)colItem, context); } else if (value instanceof Item) { Item i = (Item)value; if (XMLSystemFunctions.isNull(i)) { return null; } BuiltInAtomicType bat = typeMapping.get(type); if (bat != null) { AtomicValue av = new StringValue(i.getStringValueCS()); ConversionResult cr = Converter.convert(av, bat, config.getConversionRules()); value = cr.asAtomic(); value = getValue((AtomicValue)value, context); if (value instanceof Item) { value = ((Item)value).getStringValue(); } } else { value = i.getStringValue(); } } return FunctionDescriptor.importValue(value, type, context); }