Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-546

New fetch mode EXTRA_LAZY for collections

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.1
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      A new fetch mode EXTRA_LAZY for one-to-many and many-to-many associations could have the following effects on PersistentCollection methods:

      • count() : Does not initialize the collection but issues a straight SQL count query.
      • remove($key) : Does not initialize the collection but issues straight SQL instead.
      • removeElement($element) : Does not initialize the collection but issues straight SQL instead.
      • contains($element) : Does not initialize the collection but issues straight SQL instead.
      • containsKey($key) : Does not initialize the collection but issues straight SQL instead.

      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.

        Issue Links

          Activity

          Hide
          Benjamin Eberlei added a comment -

          Usage would be inside a @OneToMany or @ManyToMany definition set

          Annotations/XML:

          fetch="EXTRA_LAZY"
          

          YAML:

          fetch: EXTRA_LAZY
          
          Show
          Benjamin Eberlei added a comment - Usage would be inside a @OneToMany or @ManyToMany definition set Annotations/XML: fetch= "EXTRA_LAZY" YAML: fetch: EXTRA_LAZY
          Hide
          Benjamin Eberlei added a comment -

          Implemented

          Show
          Benjamin Eberlei added a comment - Implemented
          Hide
          Benjamin Eberlei added a comment -

          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.

          Show
          Benjamin Eberlei added a comment - 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.
          Hide
          Benjamin Eberlei added a comment -

          https://github.com/doctrine/doctrine2/tree/DDC-546 first prototype implementation with tests.

          Missing:

          • XML and YAML Mapping support.
          • Contains() support.
          • RemoveElement() support

          Necessary for later scheduling (only make sense when persisting keys):

          • ContainsKey() support
          • RemoveKey() support
          Show
          Benjamin Eberlei added a comment - https://github.com/doctrine/doctrine2/tree/DDC-546 first prototype implementation with tests. Missing: XML and YAML Mapping support. Contains() support. RemoveElement() support Necessary for later scheduling (only make sense when persisting keys): ContainsKey() support RemoveKey() support
          Hide
          Roman S. Borschel added a comment -

          Moved to 2.1 due to lack of time for larger new stuff for 2.0.

          Show
          Roman S. Borschel added a comment - Moved to 2.1 due to lack of time for larger new stuff for 2.0.

            People

            • Assignee:
              Benjamin Eberlei
              Reporter:
              Roman S. Borschel
            • Votes:
              3 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: