Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Map to Row Function for Insert Statements #612

Merged
merged 10 commits into from Apr 20, 2023

Conversation

jeffgbutler
Copy link
Member

This enhancement allows insert of simple classes like Integers or Strings. An example of usage with insertMultiple follows:

MultiRowInsertStatementProvider<Long> render = insertMultiple(Arrays.asList(11L, 22L, 33L))
    .into(sysUserRole)
    .map(userId).toConstant("1")
    .map(roleId).toRow()
    .build()
    .render(RenderingStrategies.MYBATIS3);

Resolves #593

# Conflicts:
#	src/main/java/org/mybatis/dynamic/sql/render/RenderingStrategy.java
# Conflicts:
#	src/main/java/org/mybatis/dynamic/sql/insert/render/AbstractMultiRowValuePhraseVisitor.java
#	src/main/java/org/mybatis/dynamic/sql/insert/render/BatchValuePhraseVisitor.java
#	src/main/java/org/mybatis/dynamic/sql/insert/render/MultiRowValuePhraseVisitor.java
@jeffgbutler jeffgbutler added this to the 1.5.0 milestone Apr 20, 2023
@coveralls
Copy link

coveralls commented Apr 20, 2023

Coverage Status

Coverage: 100.0%. Remained the same when pulling 77b0765 on jeffgbutler:map-to-row into 2aa431a on mybatis:master.

@jeffgbutler jeffgbutler merged commit d97c153 into mybatis:master Apr 20, 2023
5 checks passed
@jeffgbutler jeffgbutler deleted the map-to-row branch April 20, 2023 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible for SqlBuilder.insertMultiple to accept parameters such as List<Long>
2 participants