mybatis @Builder 주의사항
mybatis 사용시 아래와 같은 문구가 발생하였다면…?
// case 1
Caused by: java.lang.IndexOutOfBoundsException: Index 1 out of bounds for length 1
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
...
// case 2
Cause: java.lang.IndexOutOfBoundsException: Index 2 out of bounds for length 2
...원인 분석
롬복 @Builder를 사용할 땐 주의해야 할 점이 있다
빈 생성자를 정의해주자
Last updated