
·JPA
01. JPA 구동 방식 Persistence로 META-INF/persistence.xml를 읽어 설정 정보를 조회한다. EntityManagerFactory 라는 클래스를 생성한다. 필요할 때 마다 EntityManager 를 생성한다. 02. 객체와 테이블을 생성하고 매핑하기 Annotation @Entity 는 JPA가 관리할 객체임을 명시한다. @Id 는 데이터베이스의 Primary Key와 매핑할 때 사용한다. Member 클래스 작성하기 @Entity @Getter @Setter public class Member { @Id private Long id; private String name; } @Getter와 @Setter를 사용하면 다음과 같이 길게 작성해야 하는 코드를 자동으로 만들어준..