Skip to content

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

@hxj0x

Description

@hxj0x

I want to implement the following SQL

# add multiple roles for a user
insert into sys_user_role (user_id, role_id)
values (1, 11),
       (1, 22),
       (1, 33);

my mybatis dynamic sql

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

What parameters should I add to map(SysUserRoleDynamic SqlSupport. roleId).toProperty (""),Or I must provide an object for the insertMultiple method

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions