We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is how I currently implement dynamic insertion `
public static GeneralInsertStatementProvider buildInsert(FormDynamicInsert formDynamicInsert) { SqlTable sqlTable = SqlTable.of(formDynamicInsert.getTableName()); SqlBuilder.InsertIntoNextStep insertIntoNextStep = SqlBuilder.insertInto(sqlTable); for(int i=0;i<formDynamicInsert.getFields().size()-2; i++) { FormDynamicInsert.InsertField insertField = formDynamicInsert.getFields().get(i); insertIntoNextStep.set(sqlTable.column(insertField.getField())).toValue(insertField.getValue()); } FormDynamicInsert.InsertField lastInsertField = formDynamicInsert.getFields().get(formDynamicInsert.getFields().size()-1); return insertIntoNextStep.set(sqlTable.column(lastInsertField.getField())).toValue(lastInsertField.getValue()) .build().render(RenderingStrategies.MYBATIS3); }
` But I want to achieve it this way
Is there a problem with my implementation method?
The text was updated successfully, but these errors were encountered:
You can do it by directly using the GeneralInsertDSL.
public static GeneralInsertStatementProvider buildInsert(FormDynamicInsert formDynamicInsert) { SqlTable sqlTable = SqlTable.of(formDynamicInsert.getTableName()); GeneralInsertDSL dsl = GeneralInsertDSL.insertInto(sqlTable); formDynamicInsert.getFields().forEach(f -> { dsl.set(f.getField()).toValue(f.getValue()); }); return dsl.build.render(RenderingStrategies.MYBATIS3); }
Sorry, something went wrong.
No branches or pull requests
This is how I currently implement dynamic insertion
`
`
But I want to achieve it this way
Is there a problem with my implementation method?
The text was updated successfully, but these errors were encountered: