| I find that decision rather unfortunate because at least to me it makes it hard to build a model of what is going on. My personal mental model tells me the JPQL query should get executed as it is and then the result transformed into the result type requested. This would result in a) distinct Parents and therefore the cardinality of the original query b) complete Parents (each having all its children), instead of just one each. While the actual model seems to be more along the line of creating the SQL as we would do for a normal query without specific return type. Then take the ResultSet and transform it into the return type. But this isn't really the case either, because that would result with a tuple of all the Parent and Child columns. So what is the mental model one should use to predict the result of queries with a specified result type? |