-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Labels
Milestone
Description
We plan to remove partial objects in the forseeable future. This doesn't have to be ORM 3, because it depends on a few alternatives being in place.
Partial objects are a bad fix for wanting to avoid loading too much data like text fields /blobs that are not needed in the request. Three solutions are proposed to migrate towards around this deprecation and removal:
- Use data transfer objects with the
SELECT new MyDTO() - Use new fetch=Eager support with
Query::setFetchModeto implement multi-step hydration: [GH-1569] Optimize eager fetch for collections to batch query #8391 - Add support for lazy loading some properties or embeddables through a better proxy manager (this is not supported yet) Use ProxyManager #8518
As for use of PARTIAL with array hydration, a potential solution could be the introduction of a dedicated function: PARTIAL(alias, ...) that does the same that PartialExpression previously did. This could encapsulate this logic in ArrayHydrator and a specific function and avoid the polution of the DQL language with this concept.
Update: Deprecation reverted in ORM 2.20.0 and 3.3.0-dev
See #8471 (comment)
dbrumann, smilesrg, Warxcell, TomasVotruba, timching and 6 moreanyt, rribou, Webonaute, JoshLambda, drmax24 and 14 more