Problem is more general, not limited to byte array (or LOB). I’ve re-wrote your test case and created (draft) pull request 6679 Cause of the problem is method org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan#determineRowTransformer. It is wrongly for and result of array type selecting RowTransformerArrayImpl. However, in case like this one (when result is single array property) selected row transformer should be RowTransformerSingularReturnImpl. I hope that leter today I will be able to propose solution, or at least starting point to solution. |