DDC-633: fetch="EAGER" is not loading one to one associations #782

Open
opened 2026-01-22 12:50:16 +01:00 by admin · 0 comments
Owner

Originally created by @doctrinebot on GitHub (Jun 11, 2010).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user ccapndave:

<?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.

Originally created by @doctrinebot on GitHub (Jun 11, 2010). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user ccapndave: ``` <?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.
admin added the Bug label 2026-01-22 12:50:16 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#782