Untitled

✅ TYPE

• [JPQL]
select i from Item i
where type(i) IN (Book, Movie)

• [SQL]
select i from i
where i.DTYPE in (‘B’, ‘M’)

✅TREAT(JPA 2.1)

예) 부모인 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’