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

Support for Statement.RETURN_GENERATED_KEYS on InsertCreator #27

Open
divios opened this issue Dec 16, 2022 · 0 comments
Open

Support for Statement.RETURN_GENERATED_KEYS on InsertCreator #27

divios opened this issue Dec 16, 2022 · 0 comments

Comments

@divios
Copy link

divios commented Dec 16, 2022

        KeyHolder keyHolder = new GeneratedKeyHolder();
        PreparedStatementCreator psc = new InsertCreator(SHOP_TABLE)
                .setValue("shop_name", shopEntity.getName())
                .setValue("created_At", String.valueOf(shopEntity.getCreatedAt()))
                .setValue("last_renewal", String.valueOf(shopEntity.getLastRenewal()))
                .setValue("max_timer", String.valueOf(shopEntity.getMaxTimer()));

        jdbcTemplate.update(psc, keyHolder);

The code returns an exception since I need to specify Statement.RETURN_GENERATED_KEYS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant