Skip to content

Commit 2d44833

Browse files
committed
Minor optimization
1 parent 3a089bd commit 2d44833

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/org/apache/ibatis/builder/annotation/MapperAnnotationBuilder.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,13 @@ void parseStatement(Method method) {
354354
}
355355

356356
String resultMapId = null;
357-
ResultMap resultMapAnnotation = method.getAnnotation(ResultMap.class);
358-
if (resultMapAnnotation != null) {
359-
resultMapId = String.join(",", resultMapAnnotation.value());
360-
} else if (isSelect) {
361-
resultMapId = generateResultMapName(method);
357+
if (isSelect) {
358+
ResultMap resultMapAnnotation = method.getAnnotation(ResultMap.class);
359+
if (resultMapAnnotation != null) {
360+
resultMapId = String.join(",", resultMapAnnotation.value());
361+
} else {
362+
resultMapId = generateResultMapName(method);
363+
}
362364
}
363365

364366
assistant.addMappedStatement(

0 commit comments

Comments
 (0)