Closed mkp05 closed 4 years ago
That's a limitation of SQL. A query can't return an item that contains multiple elements inside of it. The joinFetchList() thing is the most you can do. Just return the entity from the query, and read out the lead and followers from the entity afterwards.
That's a limitation of SQL.
I'm aware of that. I just hoped that there is some library-side solution similar to QueryDSL's Projections.list
or Projections.set
.
Just return the entity from the query, and read out the lead and followers from the entity afterwards.
it's too much data to download this way (and this approach could be achieved using simple JpaRepository
), but I managed to come up with ugly solution with leftJoin
and then grouping and fixing the data on the application server side.
Hi, having the possibility to return Custom Tuples directly from the queries I've encountered some problems with nested collections and other entities.
Nested collection Having (simplified) entity as follows:
and custom tuple as follows:
registered by
registerCustomTupleConstructor
, I'm trying to retrieve data in a following way:I receive error like this:
Is there anything more needed to be able to map collections directly to custom tuples?