Skip to content
This repository was archived by the owner on Dec 8, 2023. It is now read-only.
This repository was archived by the owner on Dec 8, 2023. It is now read-only.

InsertBuilder.values() is not able to know previous added input values #14

@pr7vinas

Description

@pr7vinas

I might be doing something wrong, but It seems that the InsertBuilder.values() is not able to know previous added input values.

Given the following code:

List<User> users = someResourceProvider.getAllMyUsers(); // lets suppose that I have only two users
InsertBuilder insertBuilder = InsertBuilder.into("myTable").columns("name","phone");

users.forEach(user -> insertBuilder.values(user.getName(),user.getPhone());

String query = insertBuilder.build().getQuery().toString();

I was expecting String query to contain something similar to this:

INSERT INTO myTable (name,phone) VALUES (?,?) , (?,?);

However I'm getting this output:

INSERT INTO myTable (name,phone) VALUES (?,?) VALUES (?,?);

Am I missing something?
It might be the case that I misinterpreted what InsertBuilder.values() is supposed to do.

I would appreciate some feedback.
Thank you very much for your time.
Cheers.

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