Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-522

Join columns can not be named the same as the association fields.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-BETA1
    • Fix Version/s: 2.0-BETA4
    • Component/s: None
    • Security Level: All
    • Labels:
      None

      Description

      Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object (on hydration of the fetch-joined association at least).

      Example:

          /**
           * @OneToOne(...)
           * @JoinColumn(name="item", referencedColumnName="id")
           */
          private $item;
      

        Issue Links

          Activity

          Roman S. Borschel created issue -
          Roman S. Borschel made changes -
          Field Original Value New Value
          Description Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object.

          Example:

          {code}
              /**
               * NOTE that we can currently not name the join column the same as the field
               * (item = item), this currently confuses Doctrine.
               *
               * @OneToOne(...)
               * @JoinColumn(name="item", referencedColumnName="id")
               */
              private $item;
          {code}
          Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object (on hydration of the fetch-joined association at least).

          Example:

          {code}
              /**
               * NOTE that we can currently not name the join column the same as the field
               * (item = item), this currently confuses Doctrine.
               *
               * @OneToOne(...)
               * @JoinColumn(name="item", referencedColumnName="id")
               */
              private $item;
          {code}
          Roman S. Borschel made changes -
          Description Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object (on hydration of the fetch-joined association at least).

          Example:

          {code}
              /**
               * NOTE that we can currently not name the join column the same as the field
               * (item = item), this currently confuses Doctrine.
               *
               * @OneToOne(...)
               * @JoinColumn(name="item", referencedColumnName="id")
               */
              private $item;
          {code}
          Join columns can currently not be named the same as the association fields in a class. This apparently causes Doctrine to insert the identifier of the associated object instead of the actual object (on hydration of the fetch-joined association at least).

          Example:

          {code}
              /**
               * @OneToOne(...)
               * @JoinColumn(name="item", referencedColumnName="id")
               */
              private $item;
          {code}
          Roman S. Borschel made changes -
          Link This issue is required for DDC-419 [ DDC-419 ]
          Roman S. Borschel made changes -
          Fix Version/s 2.0-BETA3 [ 10060 ]
          Fix Version/s 2.0 [ 10021 ]
          Roman S. Borschel made changes -
          Fix Version/s 2.0-BETA4 [ 10072 ]
          Fix Version/s 2.0-BETA3 [ 10060 ]
          Roman S. Borschel made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          Roman S. Borschel made changes -
          Status In Progress [ 3 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Benjamin Eberlei made changes -
          Link This issue is referenced by DDC-774 [ DDC-774 ]
          Benjamin Eberlei made changes -
          Workflow jira [ 11226 ] jira-feedback [ 15616 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback [ 15616 ] jira-feedback2 [ 17480 ]
          Benjamin Eberlei made changes -
          Workflow jira-feedback2 [ 17480 ] jira-feedback3 [ 19737 ]

            People

            • Assignee:
              Roman S. Borschel
              Reporter:
              Roman S. Borschel
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: