@@ -66,22 +66,22 @@ private void processGeneratedKeys(Executor executor, MappedStatement ms, Object
66
66
Executor keyExecutor = configuration .newExecutor (executor .getTransaction (), ExecutorType .SIMPLE );
67
67
List <Object > values = keyExecutor .query (keyStatement , parameter , RowBounds .DEFAULT , Executor .NO_RESULT_HANDLER );
68
68
if (values .size () == 0 ) {
69
- throw new ExecutorException ("SelectKey returned no data." );
69
+ throw new ExecutorException ("SelectKey returned no data." );
70
70
} else if (values .size () > 1 ) {
71
- throw new ExecutorException ("SelectKey returned more than one value." );
71
+ throw new ExecutorException ("SelectKey returned more than one value." );
72
72
} else {
73
- MetaObject metaResult = configuration .newMetaObject (values .get (0 ));
74
- if (keyProperties .length == 1 ) {
75
- if (metaResult .hasGetter (keyProperties [0 ])) {
76
- setValue (metaParam , keyProperties [0 ], metaResult .getValue (keyProperties [0 ]));
77
- } else {
78
- // no getter for the property - maybe just a single value object
79
- // so try that
80
- setValue (metaParam , keyProperties [0 ], values .get (0 ));
81
- }
73
+ MetaObject metaResult = configuration .newMetaObject (values .get (0 ));
74
+ if (keyProperties .length == 1 ) {
75
+ if (metaResult .hasGetter (keyProperties [0 ])) {
76
+ setValue (metaParam , keyProperties [0 ], metaResult .getValue (keyProperties [0 ]));
82
77
} else {
83
- handleMultipleProperties (keyProperties , metaParam , metaResult );
78
+ // no getter for the property - maybe just a single value object
79
+ // so try that
80
+ setValue (metaParam , keyProperties [0 ], values .get (0 ));
84
81
}
82
+ } else {
83
+ handleMultipleProperties (keyProperties , metaParam , metaResult );
84
+ }
85
85
}
86
86
}
87
87
} catch (ExecutorException e ) {
0 commit comments