private static <T> FactoryExpression<T> createBeanProjection(RelationalPath<T> path) {
        Map<String,Expression<?>> bindings = new LinkedHashMap<String,Expression<?>>();
        for (Path<?> column : path.getColumns()) {
            bindings.put(column.getMetadata().getName(), column);
        }
        if (bindings.isEmpty()) {
            throw new IllegalArgumentException("No bindings could be derived from " + path);
        }
        return Projections.<T>fields((Class) path.getType(), bindings);
    }
{@code RelationalPathUtils} provides static utility methods for {@link RelationalPath} instances

@author tiwe
querydsl-sql/src/main/java/com/querydsl/sql/RelationalPathUtils.java