728x90 annotation1 [MyBatis] @Mapper는 언제 사용하는걸까? 안녕하세요 coding-knowjam입니다. 오늘은 @Mapper 어노테이션에 대해서 얘기해보겠습니다. 우리는 보통 Interface를 매퍼로 등록하기 위해 @Mapper 어노테이션을 사용합니다. import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; @Mapper public interface CodingNojamMapper { public String getTime(); @Select("SELECT NOW()") public String getTime2(); } 등록된 매퍼를 사용하기 위해서는 보통 아래와 같이 매퍼를 스캔할 수 있게 추가 설정을 하게 됩니다. (공식 문서 참조 : https://.. Etc 2020. 12. 30. 이전 1 다음 728x90