我有实体
<?php
namespace Proj\Bundle\MyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* ClassTop
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Proj\Bundle\MyBundle\Repository\ClassTopRepository")
* @ORM\InheritanceType("SINGLE_TABLE")
* @ORM\DiscriminatorColumn(name="aVal", type="string")
* @ORM\DiscriminatorMap({ "ValOne" = "ClassSubOne", "ValTwo" = "ClassSubTwo", "ValThree" = "ClassSubThree" })
*
*/
class ClassTop
{
.....
}
class ClassSubOne extends ClassTop
{
....
}
class ClassSubTwo extends ClassTop
{
....
}
class ClassSubThree extends ClassTop
{
....
}
我的问题是当我调用find()
(or findOneBy
, findAll
, 等) 方法时,我有一个 Oracle 错误。
$entityManager->getRepository('ProjMyBundle:ClassSubOne')->findAll()
在我的查询中
SELECT field, field2 FROM CLASSTOP WHERE aVAL IN ()
鉴别器值"ValOne"
不是映射,也不是在 Doctrine 中传递的。
任何帮助将非常感激。