[Narp] 50강_게시판 영속계층 구현하기(Mapper Interface+XML), 게시판 만들기(2)

NAM·2022년 5월 5일
0

Narp 복습

목록 보기
3/7
post-thumbnail

1.Mapper Interface를 만든다.(mapper Package안 BoardMapper)

2.mapper.xml(BoardMapper.xml)파일을 만든다.

mybatis 홈페이지로가서 시작하기란에서 mapper 파일 구문을 복사해서 xml 파일 안에 넣어준다.

3.이제 Mapper Interface와 Mapper.xml 파일을 연동해준다.

(핵심은: xml 파일의 namespace와 Mapper Interface의 이름이 같아야한다.+ 차후에는 Mapper Interface메서드 명==xml 파일의 id 명이 같게만 만들면 알아서 mapping 시켜준다.)

profile
힘내자

0개의 댓글