[DDC-2826] Add support for mapping collections of embeddable objects Created: 28/Nov/13  Updated: 08/Feb/14

Status: Open
Project: Doctrine 2 - ORM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: New Feature Priority: Major
Reporter: songoko songowan Assignee: Benjamin Eberlei
Resolution: Unresolved Votes: 2
Labels: collection, orm, value-objects


In Hibernate we can do something like this:

    public class User {
       public String getLastname() { ...}
       @CollectionTable(name="Addresses", joinColumns=@JoinColumn(name="user_id"))
          @AttributeOverride(name="street1", column=@Column(name="fld_street"))
       public Set<Address> getAddresses() { ... } 
    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

Comment by Doctrine Bot [ 08/Feb/14 ]

A related Github Pull-Request [GH-835] was closed:

Generated at Wed Oct 14 00:22:18 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.