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

Explicitly state GeneratedValue strategy for entity ID columns. #187

Closed
chrisknoll opened this issue Mar 9, 2017 · 1 comment
Closed
Milestone

Comments

@chrisknoll
Copy link
Collaborator

When updating to the latest Spring libraries described in #186, the GeneratedValue annotation (defaults to AUTO) no longer uses the IDENTITY strategy on MSSQL Server, but instead defaults to a spring-global sequencer:

select next value for webapi.hibernate_sequence

This is the behavior on PostgreSQL and Oracle, but should be made explicit, and potentially have a dedicated sequencer for each entity. The challenge is creating the DDL for these sequencers that are initialized based on a value from a select max (id) from EntityTable. I'm sure this is possible on MSSQL, but more challenging on oracle.

Alternatively, we can adopt the 'table-based' strategy which is proven to be more cross-platform friendly, tho slow when doing bulk inserts into the identity column (which is not something we do in our current webAPI anyways, so perhaps not a large issue). Further research is required.

@anthonysena anthonysena added this to the V2.4.0 milestone Apr 11, 2018
@anthonysena
Copy link
Collaborator

Think we got this with #324 so closing out this issue.

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

No branches or pull requests

2 participants