[JPA] JPQL ๋ฌธ๋ฒ 4 - ๋คํ์ฑ ์ฟผ๋ฆฌ, ์ํฐํฐ ์ง์ ์ฌ์ฉ, Named ์ฟผ๋ฆฌ
rlaehddnd0422
๋คํ์ฑ ์ฟผ๋ฆฌ JPQL์ผ๋ก ๋ถ๋ชจ ์ํฐํฐ๋ฅผ ์กฐํํ๋ฉด ์๋์ผ๋ก ๋ชจ๋ ์์ ์ํฐํฐ๊น์ง ํจ๊ป ์กฐํํฉ๋๋ค. @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "DTYPE") public abstract class Item { @Id @GeneratedValue @Column(name = "ITEM_ID") private Long id; private String name; private int price; private int stockQuantity; } JPQL SELECT i FROM Item i ๋จ์ผ ํ
์ด๋ธ ์ ๋ต์ ์ฌ์ฉํ์ ๋ ์คํ๋๋ SQL select * from Item i ์กฐ์ธ ์ ๋ต์ ์ฌ์ฉํ..