I’m currently trying to fetch data with JQPL. My Query looks like
SELECT NEW com.test.CustomObject(t1.name, CASE WHEN(t2 IS NOT NULL) THEN true ELSE false END) FROM table1 t1, table2 t2 WHERE t1.id = :id1 AND t2.id = :id2
Of course the two entities iteself exist an querying for one of them is working. Querying with a fixed value also works:
SELECT NEW com.test.CustomObject(t1.name, false) FROM table1 t1 WHERE t1.id = :id1
My problem is, that I receive no return value if :id2 has a non existing value. Instead of giving false to the CustomObject constructor, the row itself is omitted completely.
What else could I do to gain knowledge if parameter id2 has a row in table2 to pass this as a boolean value to the custom constructor?
Further information can of course be provided.
I could solve the problem with Exsists: