@@ -329,23 +329,25 @@ ps.setInt(1,id);]]></source>
329
329
</tr >
330
330
<tr >
331
331
<td ><code >useGeneratedKeys</code ></td >
332
- <td >(insert only) This tells MyBatis to use the JDBC <code >getGeneratedKeys</code > method to retrieve
332
+ <td >(insert and update only) This tells MyBatis to use the JDBC <code >getGeneratedKeys</code > method to retrieve
333
333
keys generated internally by the database (e.g. auto increment fields in RDBMS like
334
334
MySQL or SQL Server). Default: <code >false</code >
335
335
</td >
336
336
</tr >
337
337
<tr >
338
338
<td ><code >keyProperty</code ></td >
339
- <td >(insert only) Identifies a property into which MyBatis will set the key value returned
339
+ <td >(insert and update only) Identifies a property into which MyBatis will set the key value returned
340
340
by <code >getGeneratedKeys</code >, or by a <code >selectKey</code > child element of the insert statement.
341
- Default: <code >unset</code >.
341
+ Default: <code >unset</code >. Can be a comma separated list of property names if multiple
342
+ generated columns are expected.
342
343
</td >
343
344
</tr >
344
345
<tr >
345
346
<td ><code >keyColumn</code ></td >
346
- <td >(insert only) Sets the name of the column in the table with a generated key. This is
347
+ <td >(insert and update only) Sets the name of the column in the table with a generated key. This is
347
348
only required in certain databases (like PostgreSQL) when the key column is not the
348
- first column in the table.
349
+ first column in the table. Can be a comma separated list of columns names if multiple
350
+ generated columns are expected.
349
351
</td >
350
352
</tr >
351
353
<tr >
@@ -439,14 +441,25 @@ ps.setInt(1,id);]]></source>
439
441
<tbody >
440
442
<tr >
441
443
<td ><code >keyProperty</code ></td >
442
- <td >The target property where the result of the <code >selectKey</code > statement should be set.</td >
444
+ <td >The target property where the result of the <code >selectKey</code > statement should be set.
445
+ Can be a comma separated list of property names if multiple generated columns
446
+ are expected.
447
+ </td >
448
+ </tr >
449
+ <tr >
450
+ <td ><code >keyColumn</code ></td >
451
+ <td >The column name(s) in the returned result set that match the properties.
452
+ Can be a comma separated list of column names if multiple generated columns
453
+ are expected.
454
+ </td >
443
455
</tr >
444
456
<tr >
445
457
<td ><code >resultType</code ></td >
446
458
<td >
447
459
The type of the result. MyBatis can usually figure this out, but it doesn't hurt to
448
460
add it to be sure. MyBatis allows any simple type to be used as the key,
449
- including Strings.
461
+ including Strings. If you are expecting multiple generated columns, then
462
+ you can use an Object that contains the expected properties, or a Map.
450
463
</td >
451
464
</tr >
452
465
<tr >
0 commit comments