Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-633

fetch="EAGER" is not loading one to one associations

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0-BETA4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      <?php
      namespace vo;
      
      /**
       * @Entity
       */
      
      class Appointment {
      	
          /** @Id @Column(type="integer") @GeneratedValue(strategy="IDENTITY") */
          public $id;
      	
      	/**
           * @OneToOne(targetEntity="Patient", inversedBy="appointment", fetch="EAGER")
      	 * @JoinColumn(name="patient_id", referencedColumnName="id")
           */
      	public $patient;
      	
      }
      

      When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.

        Activity

        Dave Keen created issue -
        Dave Keen made changes -
        Field Original Value New Value
        Description [code]
        <?php
        namespace vo;

        /**
         * @Entity
         */

        class Appointment {

            /** @Id @Column(type="integer") @GeneratedValue(strategy="IDENTITY") */
            public $id;

        /**
             * @OneToOne(targetEntity="Patient", inversedBy="appointment", fetch="EAGER")
        * @JoinColumn(name="patient_id", referencedColumnName="id")
             */
        public $patient;

        }
        [code]

        When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.
        {code}
        <?php
        namespace vo;

        /**
         * @Entity
         */

        class Appointment {

            /** @Id @Column(type="integer") @GeneratedValue(strategy="IDENTITY") */
            public $id;

        /**
             * @OneToOne(targetEntity="Patient", inversedBy="appointment", fetch="EAGER")
        * @JoinColumn(name="patient_id", referencedColumnName="id")
             */
        public $patient;

        }
        {code}

        When doing a findAll() on appointments, $patient is being created as a proxy even though fetch is EAGER.
        Roman S. Borschel made changes -
        Fix Version/s 2.0-BETA4 [ 10072 ]
        Roman S. Borschel made changes -
        Priority Major [ 3 ] Critical [ 2 ]
        Roman S. Borschel made changes -
        Assignee Roman S. Borschel [ romanb ] Benjamin Eberlei [ beberlei ]
        Benjamin Eberlei made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 11477 ] jira-feedback [ 14457 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14457 ] jira-feedback2 [ 16321 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16321 ] jira-feedback3 [ 18574 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Dave Keen
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: