createQuery("select p.name from blogBundle:Person p
where p.id not in(select c.person from blogBundle:Category c)")->execute();
E estou recebendo este erro:
Error: Invalid PathExpression. Must be a StateFieldPathExpression
Troque sua DQL por:
SELECT p
FROM blogBundle:Person p
WHERE p.id NOT IN(
SELECT IDENTITY(p.id)
FROM blogBundle:Category c
JOIN c.person p)
Note o IDENTITY
.
O problema é o ->execute()
. Para rodar a Query você precisa utilizar o getResult()
.
A forma correta é:
$this->getEntityManager()->createQuery("select p.name from blogBundle:Person p
where p.id not in(select c.person from blogBundle:Category c)")->getResult();