mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-546: New fetch mode EXTRA_LAZY for collections #676
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Apr 27, 2010).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user romanb:
A new fetch mode EXTRA_LAZY for one-to-many and many-to-many associations could have the following effects on PersistentCollection methods:
This mode would usually be useful for (potentially) large collections.
We need to work out concrete use-case examples and implementation proposals before implementation.
The semantics of the mentioned methods with EXTRA_LAZY need to be carefully worked out, i.e. what happens to already managed instances in case of the remove operations and stuff like that.
@doctrinebot commented on GitHub (Apr 27, 2010):
@doctrinebot commented on GitHub (May 7, 2010):
Comment created by mjh_ca:
Wow, this is an excellent idea. I was just thinking how it is unfortunate that there aren't ways to manipulate large collections without resorting to DQL.
If nothing else, having access to a count() would be particularly great.
@doctrinebot commented on GitHub (May 7, 2010):
Comment created by romanb:
@Marc: You might then also be interested in a related ticket: http://www.doctrine-project.org/jira/browse/DDC-547
This would basically allow you to craft special implementations that inherit from PersistentCollection that are "optimized" in some way for a specific association (i.e. write your own custom SQL query when count() is invoked). Your wrapper class is then used by Doctrine instead of the default one, thats the idea. Of course implementing such a custom collection and overriding methods needs to be done carefully to fully preserve the public API contract (PersistentCollection wrappers are supposed to be "invisible" to the user after all). So this would be an advanced feature. EXTRA_LAZY I think is a pretty easy feature, accessible for all users with no further knowledge required. It just means that the collection delays initialization even more, whereever possible, which is a good thing for large collections which you normally don't really want to load, yet it allows you to use the normal OO API of your domain model without resorting to special (DQL) queries.
@doctrinebot commented on GitHub (May 7, 2010):
Comment created by romanb:
Oh, I just saw you're watching that one already :) sorry for the noise
@doctrinebot commented on GitHub (May 19, 2010):
Comment created by romanb:
Rescheduling for beta3 as we're running out of time.
@doctrinebot commented on GitHub (Jun 30, 2010):
Comment created by @beberlei:
Additional features that have been requested by users:
I don't know about the remove() and removeElement() operations, would they register with the UoW or directly execute the DELETE or UPDATE stements themselves?
@doctrinebot commented on GitHub (Jul 7, 2010):
Comment created by romanb:
Pushing back to beta4.
@doctrinebot commented on GitHub (Jul 12, 2010):
Comment created by romanb:
Moved to 2.1 due to lack of time for larger new stuff for 2.0.
@doctrinebot commented on GitHub (Dec 4, 2010):
Comment created by @beberlei:
https://github.com/doctrine/doctrine2/tree/DDC-546 first prototype implementation with tests.
Missing:
Necessary for later scheduling (only make sense when persisting keys):
@doctrinebot commented on GitHub (Dec 29, 2010):
Comment created by @beberlei:
I updated the branch to include XML, YAML support, refactored a little bit and added contains() support.
The RemoveElement() support should be put into its own ticket that relates to the EntityManager#link() / EntityManager#unlink() functionality.
@doctrinebot commented on GitHub (Jan 2, 2011):
Comment created by @beberlei:
Implemented
@doctrinebot commented on GitHub (Jan 2, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Jan 2, 2011):
Comment created by @beberlei:
Usage would be inside a @OneToMany or @ManyToMany definition set
Annotations/XML:
YAML: