2
I have a view, where Mapeei 3 fields as primary key and 2 of these fields are foreign keys
As below:
/**
* @var NotaFiscal
* @ORM\Id
* @ORM\ManyToOne(targetEntity="NotaFiscal", inversedBy="itens")
* @ORM\JoinColumn(name="CODIGO", referencedColumnName="CODIGO")
*/
private $notaFiscal;
/**
* @var Produto
* @ORM\Id
* @ORM\ManyToOne(targetEntity="Produto")
* @ORM\JoinColumn(name="CD_PRODUTO", referencedColumnName="CD_PRODUTO")
*/
private $produto;
/**
* @var string
* @ORM\Id
* @ORM\Column(name="CD_LOTE")
*/
private $lote;
I can’t see where the mistake is... Single id is not allowed on Composite Primary key in Entity
The 3 fields is a composite key.
– Marcio Moreira