최대 1 분 소요

JPA

thymeleaf => DB설계 할 필요 없음

Entity => DB를 자동으로 만들어줌

repository => DB를 Entity 클래스로 만들어진 객체와 RDBMS를 사용해 DB 처리를 하는 인터페이스

  • JPA : Java가 제공하는 RDBMS를 사용하는 방식 정의
  • ORM(Object Relationship Mapping) : 관계형 DB, java 클래스 간 매핑

스프링은 패키지 이름을 세개이상 써야 인식됨

작성 순서

  1. application.properties

    jdbc 드라이버로 db 연결

  2. SampleController 에 hello함수

    model.attribute로 msg 변수에 hello world 할당

  3. hello.html

    thymeleaf 이용해 controller의 msg 전달

댓글남기기