Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2826

Add support for mapping collections of embeddable objects

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All

      Description

      In Hibernate we can do something like this:

          @Entity
          public class User {
             [...]
             public String getLastname() { ...}
          
             @ElementCollection
             @CollectionTable(name="Addresses", joinColumns=@JoinColumn(name="user_id"))
             @AttributeOverrides({
                @AttributeOverride(name="street1", column=@Column(name="fld_street"))
             })
             public Set<Address> getAddresses() { ... } 
          }
          
          @Embeddable
          public class Address {
             public String getStreet1() {...}
             [...]
          }
      

      Basically a collection of value objects is mapped to a new table. Currently Doctrine2 is on its way to support value objects

      However, this implementation won't support mapping a collection of objects to a new table and the only way to circumvent this issue is to treat the address an an entity and use an one-to-many unidirectional relationship through a many-to-many join table

        Activity

        songoko songowan created issue -
        Hide
        Doctrine Bot added a comment -

        A related Github Pull-Request [GH-835] was closed:
        https://github.com/doctrine/doctrine2/pull/835

        Show
        Doctrine Bot added a comment - A related Github Pull-Request [GH-835] was closed: https://github.com/doctrine/doctrine2/pull/835

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2826, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            songoko songowan
          • Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated: