I do have a simple one-to-one association (Shop has a Place) and want to make a simple query over the Shop.
Do I automatically get also the name of the place? Automatically means that I don't need to enter any where or join.
<?php
/** @Entity **/
class Shop
{
// ...
/**
* @OneToOne(targetEntity="Place")
* @JoinColumn(name="place_id", referencedColumnName="id")
**/
private $place;
// ...
}
/** @Entity **/
class Place
{
private $id;
private $name;
}
Select would look like this:
'SELECT s
FROM Shop s'