@@ -66,22 +66,22 @@ private void processGeneratedKeys(Executor executor, MappedStatement ms, Object
6666 Executor keyExecutor = configuration .newExecutor (executor .getTransaction (), ExecutorType .SIMPLE );
6767 List <Object > values = keyExecutor .query (keyStatement , parameter , RowBounds .DEFAULT , Executor .NO_RESULT_HANDLER );
6868 if (values .size () == 0 ) {
69- throw new ExecutorException ("SelectKey returned no data." );
69+ throw new ExecutorException ("SelectKey returned no data." );
7070 } 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." );
7272 } 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 ]));
8277 } 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 ));
8481 }
82+ } else {
83+ handleMultipleProperties (keyProperties , metaParam , metaResult );
84+ }
8585 }
8686 }
8787 } catch (ExecutorException e ) {
0 commit comments