Skip to content

Commit 20f8f7b

Browse files
committed
Some doc updates for #154
1 parent 75202a0 commit 20f8f7b

File tree

2 files changed

+22
-8
lines changed

2 files changed

+22
-8
lines changed

src/site/xdoc/java-api.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ try (SqlSession session = sqlSessionFactory.openSession()) {
500500
<td><code>Method</code></td>
501501
<td><code>&lt;selectKey&gt;</code></td>
502502
<td>This annotation duplicates the <code>&lt;selectKey&gt;</code> functionality for methods annotated with
503-
<code>@Insert</code> or <code>@InsertProvider</code>. It is ignored for other methods. If you specify a
503+
<code>@Insert</code>, <code>@InsertProvider</code>, <code>@Update</code>, or <code>@UpdateProvider</code>.
504+
It is ignored for other methods. If you specify a
504505
<code>@SelectKey</code> annotation, then MyBatis will ignore any generated key properties set via the
505506
<code>@Options</code> annotation, or configuration properties.
506507
Attributes: <code>statement</code> an array of strings which is the SQL statement to execute, <code>keyProperty</code> which

src/site/xdoc/sqlmap-xml.xml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -329,23 +329,25 @@ ps.setInt(1,id);]]></source>
329329
</tr>
330330
<tr>
331331
<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
333333
keys generated internally by the database (e.g. auto increment fields in RDBMS like
334334
MySQL or SQL Server). Default: <code>false</code>
335335
</td>
336336
</tr>
337337
<tr>
338338
<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
340340
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.
342343
</td>
343344
</tr>
344345
<tr>
345346
<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
347348
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.
349351
</td>
350352
</tr>
351353
<tr>
@@ -439,14 +441,25 @@ ps.setInt(1,id);]]></source>
439441
<tbody>
440442
<tr>
441443
<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>
443455
</tr>
444456
<tr>
445457
<td><code>resultType</code></td>
446458
<td>
447459
The type of the result. MyBatis can usually figure this out, but it doesn't hurt to
448460
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.
450463
</td>
451464
</tr>
452465
<tr>

0 commit comments

Comments
 (0)