Erreur dans une relation ManyToOne

Par Aralek, il y a 7 ans


Bonjour à tous,

Voilà, je suis en train de faire mes entités sous Symfony, et je rencontre ce problème :
Column name 'Id' referenced for relation from App\Entity\Bien towards App\Entity\Client does not exist.

Voici ma classe Client :

class Client { /** * @ORM\Id() * @ORM\OneToOne(targetEntity="App\Entity\Personne") * @ORM\JoinColumn(referencedColumnName="Id", nullable=false) */ private $Id; /** * @ORM\Column(type="string", length=255, unique=true) * @Assert\Email */ private $Email; /** * @ORM\OneToMany(targetEntity="App\Entity\Bien", mappedBy="IDVendeur") */ private $BiensEnVente; /** * @ORM\OneToMany(targetEntity="App\Entity\Bien", mappedBy="IDAcheteur") */ private $BiensAchetes;

Et ma classe Bien :

class Bien { /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ private $Id; /** * @ORM\Column(type="text") */ private $Description; ... /** * @ORM\OneToOne(targetEntity="App\Entity\Localisation", cascade={"persist", "remove"}) * @ORM\JoinColumn(nullable=false) */ private $IDAdresse; /** * @ORM\ManyToOne(targetEntity="App\Entity\TypeBien", inversedBy="Biens") * @ORM\JoinColumn(nullable=false) */ private $IDType; /** * @ORM\ManyToOne(targetEntity="App\Entity\Agence", inversedBy="Biens") * @ORM\JoinColumn(nullable=false) */ private $IDAgence; /** * @ORM\ManyToOne(targetEntity="App\Entity\Client", inversedBy="BiensEnVente") * @ORM\JoinColumn(nullable=false, referencedColumnName="Id") */ private $IDVendeur; /** * @ORM\ManyToOne(targetEntity="App\Entity\Client", inversedBy="BiensAchetes") * @ORM\JoinColumn(referencedColumnName="Id") */ private $IDAcheteur;

Le truc, c'est que mes liaisons entre Bien et Agence, Adresse et Type fonctionnent parfaitement, et ce malgré mes majuscules aux Id .
Seuls les liaisons IDVendeur et IDAcheteur foirent, et je ne comprends pas pourquoi :/ ... Des idées ?

Aucune réponse