DDC-2136: convert-mapping can't create YML from Annotation when Id column is a OneToOne relationship #2689

Closed
opened 2026-01-22 14:00:39 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Nov 11, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user gergelypolonkai:

I have two entities

/****

  • @ORM\Entity
    /
    class User {
    /
    ***
    • @ORM\Id
    • @ORM\GeneratedValue(strategy="AUTO")
    • @ORM\Column(type="integer")
      */
      private $id
      }

/****

  • @ORM\Entity
    /
    class UserData {
    /
    ***
    • @ORM\Id
    • @ORM\OneToOne(targetEntity="User")
      */
      private $id
      }

When I convert these with symfony's

doctrine:mapping:convert yml test/

it generates an entity definition for UserData without any id fields, which, of course, cannot be imported to the database, as the new entity doesn't have an identifier column.

Originally created by @doctrinebot on GitHub (Nov 11, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user gergelypolonkai: I have two entities /**** - @ORM\Entity _/ class User { /_*** - @ORM\Id - @ORM\GeneratedValue(strategy="AUTO") - @ORM\Column(type="integer") */ private $id } /**** - @ORM\Entity _/ class UserData { /_*** - @ORM\Id - @ORM\OneToOne(targetEntity="User") */ private $id } When I convert these with symfony's doctrine:mapping:convert yml test/ it generates an entity definition for UserData without any id fields, which, of course, cannot be imported to the database, as the new entity doesn't have an identifier column.
admin added the Bug label 2026-01-22 14:00:39 +01:00
admin closed this issue 2026-01-22 14:00:39 +01:00
Author
Owner

@doctrinebot commented on GitHub (May 1, 2013):

Comment created by @beberlei:

Fixed in 2.4

@doctrinebot commented on GitHub (May 1, 2013): Comment created by @beberlei: Fixed in 2.4
Author
Owner

@doctrinebot commented on GitHub (May 1, 2013):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (May 1, 2013): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2689