class HibernateProjectedResultMapper {

    public <T, R> R mapResult(Object o, Query<T, R> query, String[] returnFields) {
        return query.getEntityClass().equals(query.getReturnType())
                ? query.getReturnType().cast(o)
                : mapper.mapTo(query.getReturnType(), o, returnFields);
    }

    public  HibernateProjectedResultMapper(ProjectedResultMapper mapper);

}