Faça um relacionamento one to manyOneToMany
.
Classe VendaVenda
:
/**
* @ORM\Entity
* @ORM\Table(name="Venda")
*/
class Venda
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\OneToMany(targetEntity="ItensVenda", mappedBy="venda", cascade={"remove"})
*/
protected $itensVenda;
/** demais atraibutos**atributos**/
}
Classe ItensVendaItensVenda
:
/**
* @ORM\Entity
* @ORM\Table(name="ItensVenda")
*/
class ItensVenda
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue
*/
protected $id;
/**
* @ORM\ManyToOne(targetEntity="Venda", inversedBy="itensVenda")
* @ORM\JoinColumn(name="venda_id", referencedColumnName="id", nullable=FALSE)
*/
protected $venda;
/** demais atraibutos**atributos**/
}