@@ -50,20 +50,23 @@ public MapperMethod(Class<?> mapperInterface, Method method, Configuration confi
50
50
}
51
51
52
52
public Object execute (SqlSession sqlSession , Object [] args ) {
53
- Object result , param ;
53
+ Object result ;
54
54
switch (command .getType ()) {
55
- case INSERT :
56
- param = method .convertArgsToSqlCommandParam (args );
55
+ case INSERT : {
56
+ Object param = method .convertArgsToSqlCommandParam (args );
57
57
result = rowCountResult (sqlSession .insert (command .getName (), param ));
58
58
break ;
59
- case UPDATE :
60
- param = method .convertArgsToSqlCommandParam (args );
59
+ }
60
+ case UPDATE : {
61
+ Object param = method .convertArgsToSqlCommandParam (args );
61
62
result = rowCountResult (sqlSession .update (command .getName (), param ));
62
63
break ;
63
- case DELETE :
64
- param = method .convertArgsToSqlCommandParam (args );
64
+ }
65
+ case DELETE : {
66
+ Object param = method .convertArgsToSqlCommandParam (args );
65
67
result = rowCountResult (sqlSession .delete (command .getName (), param ));
66
68
break ;
69
+ }
67
70
case SELECT :
68
71
if (method .returnsVoid () && method .hasResultHandler ()) {
69
72
executeWithResultHandler (sqlSession , args );
@@ -75,7 +78,7 @@ public Object execute(SqlSession sqlSession, Object[] args) {
75
78
} else if (method .returnsCursor ()) {
76
79
result = executeForCursor (sqlSession , args );
77
80
} else {
78
- param = method .convertArgsToSqlCommandParam (args );
81
+ Object param = method .convertArgsToSqlCommandParam (args );
79
82
result = sqlSession .selectOne (command .getName (), param );
80
83
}
81
84
break ;
0 commit comments