Affects Version/s: Git Master
Fix Version/s: None
Security Level: All
I'm using the brand new embedded objects in doctrine ORM in a DDD application. It's so great that you guys added this feature which enables clean DDD Value Objects!
What does not seem to work so far is using an embeddable as primary key.
I have an enbeddable "CarId" which has only one field "value" representing the uuid for the parent entity "Car".
I tried to get this to work with different approaches, but with no success.
I'm able to define the primary key in the embeddable itself, sample .yml:
This ends up with a valid entity, but the field holding the id is named id_id. Setting an empty columnPrefix does not work:
So it is ignored if it's empty because of
So one possibility could be to change this so it accepts empty values or add a switch noPrefix = bool
Not sure if this would break in other places, though. Also it seems quite hacky.
I think a better solution would be to add something like associationKey, maybe embeddedKey, to the mapping.
Would be really great if you could add that feature. I think a Value Object to represent the id of an entity is a must have in a DDD application. It would be possible to passt that id object around, instead of a plain string/integer.