Doctrine2.3 and OneToOne cascade persist doesn't seem to work

后端 未结 2 732
余生分开走
余生分开走 2021-01-13 07:09

I have two entites (User and UserPreferences) that I want to map OneToOne unidirectional.

The code looks something like this:

/**
 * @ORM\\Table(\"us         


        
2条回答
  •  滥情空心
    2021-01-13 07:29

    Bug was with

     * @ORM\Column(name="user_preferences_id", type="integer")
    

    Your code should contain

     * @ORM\JoinColumn(name="user_preferences_id", referencedColumnName="id")
    

    instead of this.

提交回复
热议问题