- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 symfony2 上运行的网站。
我有这个 dql 查询:
SELECT b, d, al, a
FROM Bundle:Book b
LEFT JOIN b.document d
LEFT JOIN b.authorLinks al
LEFT JOIN al.author a
WHERE d.type = 'summary'
ORDER BY b.name ASC
在本地我没有任何问题,但在生产中我遇到了这个问题:
... LEFT JOIN LEFT JOIN ...
因此,第一个 LEFT JOIN(b.document d)在生产环境中不起作用,但在本地运行良好......(其他 LEFT JOIN(authorLinks 和作者)都适用)
我的Book
实体有:
/**
* @var \Doctrine\Common\Collections\ArrayCollection
*
* @ORM\OneToMany(targetEntity="Document", mappedBy="book")
* @ORM\OrderBy({"name" = "ASC"})
*/
protected $document;
我的Document
实体有:
/**
* @var Book
*
* @ORM\ManyToOne(targetEntity="Book", inversedBy="document")
* @ORM\JoinColumn(name="book_id", referencedColumnName="id", nullable=true)
* @Assert\NotBlank
*/
protected $book;
有什么想法吗?谢谢
最佳答案
解决了!
我在“LEFT JOIN b.document d”之后添加了“with d.book_id = b.id”
并添加
/**
* @var book_id
* @ORM\Column(name="book_id", type="integer")
* @Assert\NotBlank
*/
protected $book_id;
在文档实体中
谢谢大家!
关于php - 仅在生产中空左连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39348737/
这个问题已经有答案了: How does a for loop work, specifically for(;;)? (6 个回答) 已关闭 7 年前。 我正在查看 java.util.Random
平台:x32 上的 .NET Framework 3.5 SP1 在代码中留下空语句(“;”本身)是否存在任何性能问题? 要标记为答案,您是否还会教一个人(我?和其他阅读本文的人)钓鱼?意思是,如何确
我找到了有关在选中时更改实际复选标记颜色的说明,但我正在尝试弄清楚如何更改框的颜色。 我把盒子放在较暗的背景上,很难看清,所以我想让它变亮。 我已经尝试了大多数其他元素在 Materialise 中观
在 Java 中,如何生成空/“nil”的实例 java.util.UUID所有 128 位都为零的对象? 00000000-0000-0000-0000-000000000000 Nil UUID
我有一个带有 ListView 和另一个 Activity 的选项卡。那是我的代码: TabHost tabHost = getTabHost(); TabHost.TabSpec spec; I
当我做计算机科学圈第14章的题时,我发现了一些奇怪的事情。 问题说:“定义一个函数 postalValidate(S),它首先检查 S 是否代表有效的邮政编码:首先,删除所有空格;余数必须采用 L#L
clearfix div 中空注释的目的是什么?我假设这是针对某种较旧的浏览器填充程序;不确定你为什么要四处乱放空评论。似乎只有一两个 CSS 规则会更容易维护。 最佳答案 如果网站使用 displa
我在 IE8 中的 z-index 有问题(其他 IS 尚未测试): 以下 JS 创建了一些 html/css: document.write(''); document.write(' '
我是一名优秀的程序员,十分优秀!