in in odtrine2中加入和加入之间有什么区别?
?我在手册中找不到任何相关信息。
ON
替换原始联接条件,
WITH
向其添加条件。
示例:
[Album] ---OneToMany---> [Track]
案例一个
dql
FROM Album a LEFT JOIN a.Track t WITH t.status = 1
将在SQL
中翻译FROM Album a LEFT JOIN Track t ON t.album_id = a.id AND t.status = 1
案例两个
dql
FROM Album a LEFT JOIN a.Track t ON t.status = 1
将在SQL
中翻译FROM Album a LEFT JOIN Track t ON t.status = 1