Skip to content

[refactor] SampleMapper XML → @EgovMapper 어노테이션 전환#44

Open
dasomel wants to merge 1 commit into
eGovFramework:mainfrom
dasomel-eGovFramework:refactor/egov-mapper-annotation-5.0.x
Open

[refactor] SampleMapper XML → @EgovMapper 어노테이션 전환#44
dasomel wants to merge 1 commit into
eGovFramework:mainfrom
dasomel-eGovFramework:refactor/egov-mapper-annotation-5.0.x

Conversation

@dasomel
Copy link
Copy Markdown
Contributor

@dasomel dasomel commented May 20, 2026

목적

egovframe-boot-sample-java-config 프로젝트의 SampleMapper XML 매퍼를 eGovFrame 5.0 @EgovMapper 어노테이션 방식으로 전환합니다.

작업 내용

  1. SampleMapper 인터페이스 어노테이션 전환:
    • , , , CRUD 메소드에 MyBatis 어노테이션 (@Insert, @Update, @Delete, @Select, @Results) 적용
  2. EgovSample_Sample_SQL.xml 리팩토링:
    • 어노테이션으로 전환된 CRUD 메소드에 대한 XML 쿼리 구문 제거
    • MyBatis 어노테이션에서 List<?> 와일드카드 리턴 타입 매핑 시 EgovMap (IterableMap 상속 구조) 객체 매핑에 대한 기술적 한계(UnsupportedOperationException 발생)로 인해, 동적 SQL이 포함된 selectSampleListselectSampleListTotCnt는 XML 구조에 보존
  3. EgovSampleControllerTestAddTest 테스트 케이스 수정:
    • 컨트롤러 테스트의 mock request URI를 실제 매핑 경로인 /addSample.do로 일치시켜 테스트 통과 보장

검증 결과

  • mvn clean test 를 실행하여 전체 테스트 스위트가 빌드 및 테스트 통과함을 확인하였습니다.

- Move CRUD operations (insert, update, delete, select) in SampleMapper from XML to Java annotations
- Remove the migrated CRUD query tags and resultMap from EgovSample_Sample_SQL.xml
- Retain dynamic queries selectSampleList and selectSampleListTotCnt in XML due to List<?> wildcard return type mapping limitations in MyBatis annotation mapping
- Correct request path in EgovSampleControllerTestAddTest to use /addSample.do
@dasomel dasomel changed the base branch from 5.0.x to main May 26, 2026 15:53
@dasomel dasomel changed the title [refactor][5.0.x] SampleMapper XML → @EgovMapper 어노테이션 전환 [refactor] SampleMapper XML → @EgovMapper 어노테이션 전환 May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant