I have a query that looks like this:
My user entity has a one-to-one relation that looks like this:
/**
* @var UserProfile
*
* @ORMOneToOne(targetEntity="UserProfile",mappedBy="user")
*/
private $userProfile;
Anytime I make a query to select multiple user objects, it creates an additional select statement per user to query for the UserProfile data even though I am not accessing it through a get method. I don't always need the UserProfile data, and I certainly don't want to load this data every single time I'm displaying a list of users.
Any idea why these queries are executed at run time?
question from:https://stackoverflow.com/questions/12362901/doctrine2-one-to-one-relation-auto-loads-on-query