Skip to content

Commit 67b3f64

Browse files
committed
Documentation for Map to Row
1 parent 8cef8a9 commit 67b3f64

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ The pull request for this change is ([#591](https://github.com/mybatis/mybatis-d
112112
5. Add `SqlBuilder.concat` and the equivalent in Kotlin. This is a concatenate function that works on more databases.
113113
([#573](https://github.com/mybatis/mybatis-dynamic-sql/pull/573))
114114
6. Several classes and methods in the Kotlin DSL are deprecated in response to the new "having" support
115+
7. Added support for inserting a list of simple classes like Integers, Strings, etc. This is via a new "map to row"
116+
function on the insert, batch insert, and multirow insert statements.
115117

116118
## Release 1.4.1 - October 7, 2022
117119

src/site/markdown/docs/insert.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Notice the `map` method. It is used to map a database column to an attribute of
4242
3. `map(column).toStringConstant(constant_value)` will insert a constant into a column. The constant_value will be written into the generated insert statement surrounded by single quote marks (as an SQL String)
4343
4. `map(column).toProperty(property)` will insert a value from the record into a column. The value of the property will be bound to the SQL statement as a prepared statement parameter
4444
5. `map(column).toPropertyWhenPresent(property, Supplier<?> valueSupplier)` will insert a value from the record into a column if the value is non-null. The value of the property will be bound to the SQL statement as a prepared statement parameter. This is used to generate a "selective" insert as defined in MyBatis Generator.
45+
6. `map(column).toRow()` will insert the record itself into a column. This is appropriate when the "record" is a simple class like Integer or String.
4546

4647
### Annotated Mapper for Single Row Insert Statements
4748
The InsertStatementProvider object can be used as a parameter to a MyBatis mapper method directly. If you

0 commit comments

Comments
 (0)