Will not do. I misunderstood how result transformers are used; generally, it seems they are used on raw queries, created through org.hibernate.SharedSessionContract#createQuery(java.lang.String) or org.hibernate.query.QueryProducer#createNativeQuery(java.lang.String) (without a Class<R> resultClass parameter. There is no type-safety whatsoever. What's more, result transformers have been deprecated since ORM 5.2. Finally, Hibernate Search users can totally use composite projections to apply transformations to the hits: file:///home/yrodiere/tmp/build/hibernate-search-parent/ca07e8d9cfbcc7d183c488d4adb440b072105a34/documentation/target/dist/reference/en-US/html_single/index.html#search-dsl-projection-composite So, result transformers are not useful in this case and will be removed soon anyway. |