Symfony2 Doctrine2 trouble with optional one to one relation

后端 未结 5 1569
小蘑菇
小蘑菇 2021-01-01 12:53

I have a problem with Doctrine2 in Symfony2 and two relationed entities.

There is a user-entity that can (not must) have a usermeta-entity referenced which

5条回答
  •  情书的邮戳
    2021-01-01 13:20

    Reading my own old question is quite fun since I see the problem at first glance now..

    When it came to a solution I've thought that doctrine can only handle Ids named "id", but ... aduserid is just not marked as ID, it's missing the Id annotation and doctrine cannot use the fields for the join column..

    Second thing, Zdenek Machek was right: It has to be marked as nullable.

提交回复
热议问题