[FLOW3-general] Join column not created for OneToOne relationship

Sebastian Kurfürst sebastian at typo3.org
Tue Jan 3 05:58:39 CET 2012


Hey Jackie,

Am 03.01.12 05:44, schrieb Jackie Stallard:
> Hi
>
> I'm new to Flow3 and am having difficulty creating a OneToOne
> unidirectional mapping. Doctrine updates with no errors but does not
> create a join column in my table.
>
> /**
>  * @FLOW3\Scope("prototype")
can be removed, as prototype scope is the default.
>  * @FLOW3\Entity
>  */
> class CommunicationsDeviceTest {
>
>         /**
>          * @ORM\OneToOne(targetEntity="CommunicationsTypeTest")
>          * @ORM\JoinColumn(name="communicationsType_id",
> referencedColumnName="id")
The above two annotations should be:
@var \Your\Full\Namespace\To\CommunicationsTypeTest
@ORM\OneToOne
>          */
>         protected $communicationsType;
> etc.
> }
>
> /**
>  * @FLOW3\Scope("prototype")
Prototype annotation can be removed, see above.
>  * @FLOW3\Entity
>  */
> class CommunicationsTypeTest {
>
>         /**
>          * The id
>          * @var integer
>          * @ORM\Id
>          * @ORM\GeneratedValue
>          */
>         protected $id;
You should completely remove the above stuff; FLOW3 automatically
handles the identity of an object for you.

Greets,
Sebastian


More information about the FLOW3-general mailing list