I'm using NativeQuery with hibernate-core(6.0.0.Alpha6). It has no effect while I use setResultTransformer(include setTupleTransformer or setResultListTransformer). This is the demo I wrote for debugging:
Query nativeQuery = entityManager.createNativeQuery("select t.id as id, t.code as code, t.enum_value as enumValue from my_table t");
List resultList = nativeQuery.getResultList();
The type of element in "resultList" is always Object. Finally I found that it was the problem with NativeQueryImpl#createQueryPlan. Tt just returned rowTransformer and it was just defined as null.