Need to implement sql query like:
SELECT A.class, A.section
FROM
STUDENT A
INNER JOIN DEPARTMENT on A.student_id = B.id
WHERE DEPT_NBR is not null
UNION ALL
SELECT A.class, A.section
FROM
TEACHER A
INNER JOIN DEPARTMENT on A.teacher_id = B.id
WHERE DEPT_NBR is not null
How can I write such statement with QueryDSL ? ( I am not using any JPA). Any help/hint is much appreciated!