Mysql DQL查询失败

Mysql DQL查询失败,mysql,join,symfony1,doctrine,dql,Mysql,Join,Symfony1,Doctrine,Dql,我在MySQL数据库中有两个表,我使用的是doctrine 1.2和symfony 1.4.4 已安装的基础和备件 Installedbase: ib_id app_id location 及 现在我想加入到表中,以显示有多少应用程序处于空闲状态 e、 g 条令知道app_id字段上的表之间存在关系,但我得到了错误 500 | Internal Server Error | Doctrine_Hydrator_Exception "Spare" with an alias of "s" in

我在MySQL数据库中有两个表,我使用的是doctrine 1.2和symfony 1.4.4

已安装的基础和备件

Installedbase:
ib_id
app_id
location

现在我想加入到表中,以显示有多少应用程序处于空闲状态

e、 g

条令知道app_id字段上的表之间存在关系,但我得到了错误

500 | Internal Server Error | Doctrine_Hydrator_Exception 
"Spare" with an alias of "s" in your query does not reference the parent component it is related to.
亚马尔:
我搞不懂这个,有人知道条令在抱怨什么吗?

从表面上看,你还没有告诉条令这两个表是相关的

->from('InstalledBase i, i.Spare s')
。。。查询中别名为“s”的“备用”不引用与其相关的父组件


请在此查询中添加一些进一步的条件,以避免返回两个表中的所有内容。

请编辑您的问题,并向我们显示您的架构中的相关部分,包括relations.done In my schema.yml我在两个app_id字段中都添加了一对多关系,因此它应该知道。
500 | Internal Server Error | Doctrine_Hydrator_Exception 
"Spare" with an alias of "s" in your query does not reference the parent component it is related to.
->from('InstalledBase i, i.Spare s')