Skip to content

범용 @DefaultValue 어노테이션 지원 #118

Description

@coderabbitai

개요

이슈 #117 에서 boolean 타입의 DEFAULT '0' 하드코딩 버그 분석 중 도출된 후속 개선 항목입니다.

배경

현재 MySqlJavaTypeMapper에서 boolean/Boolean 타입에 DEFAULT '0'이 하드코딩되어 있어, 사용자가 필드에 = true를 초기화해도 DDL에 DEFAULT '0'이 출력되는 문제가 있습니다.
단기 조치로 해당 하드코딩을 제거하더라도, 사용자가 컬럼에 원하는 기본값을 직접 지정할 수 있는 범용 방법이 없습니다.

목표

사용자가 엔티티 필드에 어노테이션을 통해 DDL DEFAULT 절을 명시적으로 지정할 수 있도록 @DefaultValue 어노테이션을 설계하고 구현합니다.

요구사항

  • boolean, int, String모든 타입에서 사용 가능한 범용 어노테이션으로 설계
  • ColumnBuilderFactoryfrom()fromAttributeDescriptor() 양쪽에서 어노테이션을 읽어 ColumnModel.defaultValue에 반영
  • APT(Annotation Processing Tool) 환경의 getConstantValue() 한계를 파악하고, 설계 문서 또는 주석으로 명시
  • 기존 TypeMapper의 defaultValue 필드와의 우선순위 정책 명확화

관련 이슈

요청자

@yyubin

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions