I have the following referential constraints setup so that, in:
Table A, Table B, Table C
A.bid = B.id
B.cid = c.id
I need to run a query that retrieves a Table A object with following filters:
A.someCol = 'someVal' and C.someCol='someVal'
So far I have been able to come up with this. This returns a TableAObj but TableCObj is null:
select new TableAObj(TableBObj,TableCObj)
from TableAObj as tao
left join tao.TableBObj as tbo
left join tbo.TableCObj as tco
where tao.someCol = ? and tco.someCol = ?
What is my query missing?
Thanks.
Figured it out. Here’s the query:
Didn’t need the overloaded constructor or the explicit joins.