JPA
야매로 배우는 JPA
관계형 데이터베이스와 자바
기존 JDBC를 이용할때 문제점?
JDBC 코드 샘플
public class Application {
public static void main(String[] args) throws SQLException {
String url = "jdbc:postgresql://localhost:5432/springdata";
String username = "root";
String password = "0000";
try(Connection connection = DriverManager.getConnection(url, username, password)){
System.out.println("Connection created: "+ connection);
String sql = "CREATE TABLE ACCOUNT (id int, username varchar(255), password varchar(255));";
sql = "INSERT INTO ACCOUNT VALUES(1, 'root', '0000');";
try(PreparedStatement statement = connection.prepareStatement(sql)){
statement.execute();
}
}
}
}
ORM이란
도메인 모델을 사용하려는 이유?
비침투성 논란의 여지
ORM 패러다임 불일치
JPA DDL 자동설정 옵션
JDBC 사용시 application_properties
맵핑 어노테이션
EntityManager

Fetch
Book

Book Store

잘못된 예시

정답

Last updated