java와 jpa
-
jpa) DB와 매핑 어노테이션 @Entity, @Table, @Id, @ColumnJAVA/ORM 2024. 5. 14. 18:25
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스어노테이션이란?자바 컴파일러에게 문법 에러를 체크하도록 정보를 제공하기 위해 사용되는 클래스이다.프로그램을 빌드할때 코드를 자동으로 생성할 수 있도록 정보를 제공한다.런타임에 특정 기능을 실행하도록 정보를 제공한다.개발자 입장에서 더욱 직관적이기에 코드를 이해하기 쉽다.다른 사람에게 설명할 수 있도록 정보를 제공한다.기본 코드public class SangpumTable { private int code; private String sang; private int su; private int dan; public SangpumTable() { // jpa에서 생성자는 비어있어도 무조건 적어줘야한다. }데이터베이스 ✔ @..