I have four entities: OfficialDocument
, Media
, NMediaStatus
and NMediaType
. I\'m trying to translate this SQL:
I answer myself since I found how to fix it:
$qb->select('IDENTITY(od.media)', 'IDENTITY(od.type) AS doc_type', 'IDENTITY(od.status) AS doc_status', 'md.url', 'nms.name', 'nmt.name');
Since od.media
, od.type
, od.status
are composite keys then I need to add IDENTITY
in order to make the query work and fix the issue
Simply you can use ()
where composite keys exist.
$qb->select('(od.media)', '(od.type) AS doc_type', '(od.status) AS doc_status', 'md.url', 'nms.name', 'nmt.name');