added a comment - - edited
fetch=EAGER still is not working as I think it should.
class Project {
/**
- @id
- @column(type="integer")
- @generatedValue(strategy="SEQUENCE")
*/
private $id;
/**
- @manyToOne(targetEntity="Client", inversedBy="projects", fetch="EAGER")
- @joinColumn(name="id_client", referencedColumnName="id",nullable=false, onDelete="cascade")
*/
private $client;
but after
$this->getEntityManager()>find('\Entities\Project', $this>project);
2 doctrine queries are executed:
SELECT t0.id AS id1, t0.name AS name2, t0.paths AS paths3, t0.modified AS modified4, t0.created AS
created5, t0.has_running_tasks AS has_running_tasks6, t0.tasksCount AS taskscount7, t0.productsCount
AS productscount8, t0.id_client AS id_client9
FROM projects t0
WHERE t0.id = ?
SELECT t0.id AS id1, t0.name AS name2, t0.modified AS modified3, t0.created AS created4
FROM clients t0
WHERE t0.id = ?
And it should be one query with inner join to clients.
Fixed in master