public Table<T> apply(final List<Object> arguments) { final List<Expression> list = new ArrayList<Expression>(); for (Object argument : arguments) { list.add(Expressions.constant(argument)); } try { final Object o = method.invoke(schema, arguments.toArray()); return new ReflectiveTable<T>( schema, elementType, relDataType, Expressions.call( schema.getTargetExpression(), method, list)) { public Enumerator<T> enumerator() { @SuppressWarnings("unchecked") final Enumerable<T> enumerable = toEnumerable(o); return enumerable.enumerator(); } }; } catch (IllegalAccessException e) { throw new RuntimeException(e); } catch (InvocationTargetException e) { throw new RuntimeException(e); } } };
relDataType, Expressions.field( ReflectiveSchema.this.getTargetExpression(), field)) { public String toString() {
@Override public Expression getExpression(SchemaPlus schema, String tableName, Class clazz) { return Expressions.field( schema.unwrap(ReflectiveSchema.class).getTargetExpression( schema.getParentSchema(), schema.getName()), field); } }