JPQL
select i from Item i
where type(i) IN (Book, Movie)
SQL
select i from i
where i.DTYPE in ('B', 'M')
ex) 부모인 Item과 자식 Book
JPQL
select i from Item i
where treat(i as Book).author = 'kim'
SQL
select i.* from Item i
where i.DTYPE='B' and i.author = 'kim'
참고 :
김영한. 『자바 ORM 표준 JPA 프로그래밍』. 에이콘, 2015.