Skip to content

DATAJDBC-98 - update implemented. #4

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

Closed
wants to merge 7 commits into from

Conversation

schauder
Copy link
Contributor

New instances get saved with an insert statement. Existing instances get updated.

Also added some test to find certain corner cases that I feared may cause problems:

  • Id properties being not editable (no setter and final).
  • Id properties being primitive.
  • Id properties not being named "Id"
    and fixed the issues resulting from those.

Creation of the necessary sql statements is now dynamic and driven in a
trivial way by the entity.

Known issues with the solution that need to get fixed later:

Sql generating code is in the repository and should go somewhere else.

Mapping logic is very trivial and should go in a separate place.
No longer using batch inserts, which won't (easily) hold up for long anyway, since we need to decide between update and insert anyway. If one wants to support batch insert one also has to check if any autoid columns are present, because those seem not to work with batch inserts with many or at least some drivers.

Related ticket: SPR-1836.
New instances get saved with an insert statement. Existing instances get updated.

Also added some test to find certain corner cases that I feared may cause problems:
- Id properties being not editable (no setter and final).
- Id properties being primitive.
- Id properties not being named "Id"
and fixed the issues resulting from those.
@schauder schauder closed this Mar 6, 2017
@schauder
Copy link
Contributor Author

schauder commented Mar 6, 2017

Will get reviewed in #5

@odrotbohm odrotbohm deleted the issue/DATAJDBC-98 branch June 19, 2017 11:50
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

Successfully merging this pull request may close these issues.

1 participant