Let's say you have
class EntityA {
private $id;
privated $sharedUniqueId;
}
class EntityB {
private $id;
private $sharedUniqueId;
}
//EntityA is in an OneToMany Relation with EntityB
How can one make a OneToMany Association without doctrine creating entityA_id
on EntityB and by using the $sharedUniqueId
attribute. I have been looking through the doc, but I still can't find this specific case. Note that, I do not want to create a primary key composed of {id,sharedUniqueId}
For further Information, the context is from the creation of a table through INSERT INTO ... SELECT ... ON DUPLICATE KEY
and the referencing of the table is done through this custom id which I know will not change if I ever Re-upate the original data hence changing the ids.
EDIT
Why did I get downvote ?
And here is the same question asked. Is it possible to reference a column other than 'id' for a JoinColumn?