Collection querying support #7068
Replies: 2 comments 1 reply
-
Funnily, enough, IIRC, we used to have something quite like this in much older versions of Hibernate, and it was removed at some stage (probably because the actual implementation sucked). Re-adding something like this, but doing it properly, is something that had already occurred to me so 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi, I had the following discussion with Christian https://discourse.hibernate.org/t/optimize-left-join-fetch/8280/16 My usecase is as follow: Now imagine that the loaded persons are persons whose id is : 1,2,3,…30_000 If I use @batchsize(size=50) for example (whatever the size is) This is why I’ve asked for a syntax like “FROM Person p.id LEFT JOIN FETCH p.dogs” (or any other solution that allows me to retrieve only the id of a previously loaded object)…and the reason is that a Person has lot of data and returning them multiple time when I have to LEFT JOIN FETCH is not efficient. Any comments ? |
Beta Was this translation helpful? Give feedback.
-
The idea is to allow querying and DML for collections roles which would make a
CollectionPersister
the root. Syntax suggestion for referring toCollectionPersister
isEntityName.collectionAttribute
and also throughfqn.EntityClass.collectionAttribute
.I'm pretty sure that much of the custom SQL bits in Envers could be replaced with this new feature, given that I recently saw audited collections being implemented by a specially named dynamic entity.
Beta Was this translation helpful? Give feedback.
All reactions