Implementing object mapping when querying to transform types