Skip to content

Java Record List Upsert #2356

Closed Answered by JoshDoug
JoshDoug asked this question in Q&A
Discussion options

You must be logged in to vote

I needed to wrap content in VALUES() and remove the colon:

@SqlUpdate("""
               INSERT INTO example (join1_id, join2_id, content)
               VALUES <values>
               ON DUPLICATE KEY UPDATE content = VALUES(content)
               """)
    int upsertExampleContentList(@BindMethodsList(value = "values", methodNames = {"join1Id", "join2Id", "content"}) List<Example> exampleContentList);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by JoshDoug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant