/** Returns a table based on a particular field of this schema. If the * field is not of the right type to be a relation, returns null. */ private <T> Table fieldRelation(final Field field) { final Type elementType = getElementType(field.getType()); if (elementType == null) { return null; } Object o; try { o = field.get(target); } catch (IllegalAccessException e) { throw new RuntimeException( "Error while accessing field " + field, e); } @SuppressWarnings("unchecked") final Enumerable<T> enumerable = toEnumerable(o); return new FieldTable<T>(field, elementType, enumerable); }
public <T> TableFunction<T> methodMember(final Method method) { final ReflectiveSchema schema = this; final Type elementType = getElementType(method.getReturnType()); final RelDataType relDataType = typeFactory.createType(elementType); final Class<?>[] parameterTypes = method.getParameterTypes();
final Type elementType = getElementType(field.getType()); if (elementType == null) { return null;