@@ -130,13 +130,15 @@ public void parse() {
130
130
assistant .setCurrentNamespace (type .getName ());
131
131
parseCache ();
132
132
parseCacheRef ();
133
- Method [] methods = type .getMethods ();
134
- for (Method method : methods ) {
133
+ for (Method method : type .getMethods ()) {
134
+ if (!canHaveStatement (method )) {
135
+ continue ;
136
+ }
137
+ if (getSqlCommandType (method ) == SqlCommandType .SELECT && method .getAnnotation (ResultMap .class ) == null ) {
138
+ parseResultMap (method );
139
+ }
135
140
try {
136
- // issue #237
137
- if (!method .isBridge ()) {
138
- parseStatement (method );
139
- }
141
+ parseStatement (method );
140
142
} catch (IncompleteElementException e ) {
141
143
configuration .addIncompleteMethod (new MethodResolver (this , method ));
142
144
}
@@ -145,6 +147,11 @@ public void parse() {
145
147
parsePendingMethods ();
146
148
}
147
149
150
+ private boolean canHaveStatement (Method method ) {
151
+ // issue #237
152
+ return !method .isBridge () && !method .isDefault ();
153
+ }
154
+
148
155
private void parsePendingMethods () {
149
156
Collection <MethodResolver > incompleteMethods = configuration .getIncompleteMethods ();
150
157
synchronized (incompleteMethods ) {
@@ -347,11 +354,13 @@ void parseStatement(Method method) {
347
354
}
348
355
349
356
String resultMapId = null ;
350
- ResultMap resultMapAnnotation = method .getAnnotation (ResultMap .class );
351
- if (resultMapAnnotation != null ) {
352
- resultMapId = String .join ("," , resultMapAnnotation .value ());
353
- } else if (isSelect ) {
354
- resultMapId = parseResultMap (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
+ }
355
364
}
356
365
357
366
assistant .addMappedStatement (
0 commit comments