-
Notifications
You must be signed in to change notification settings - Fork 352
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
Added Sequence generation support #1955
Conversation
Hey, great to see a new contribution. We discussed identifier generation a while ago and wanted explore pathways forward. The implemented |
@mp911de So, basically, what we want to achieve is the following:
Where we support sequence generation for various fields, along with generation via identitiy columns in database via |
While not necessarily generating In the long run, I could also imagine some |
...jdbc/src/main/java/org/springframework/data/jdbc/core/convert/DefaultDataAccessStrategy.java
Outdated
Show resolved
Hide resolved
...data-jdbc/src/main/java/org/springframework/data/jdbc/core/convert/SqlParametersFactory.java
Show resolved
Hide resolved
...c/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryIntegrationTests.java
Outdated
Show resolved
Hide resolved
/** | ||
* The id should be dervied from the database sequence | ||
*/ | ||
SEQUENCE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we need this.
c24faba
to
1a5dfeb
Compare
Signed-off-by: mipo256 <[email protected]>
Hey @schauder. I've fixed most of the comments you left, apart from a single comment. Please, read my explanation. Apart from this - everything is fixed. |
Ids can be annotated with @sequence to specify a sequence to pull id values from. Closes #1923 Original pull request #1955 Signed-off-by: mipo256 <[email protected]> Some accidential changes removed. Signed-off-by: schauder <[email protected]>
Reference issues in tests comments. Removed `DisabledOnDatabase` IdGeneration default methods related to sequence generation are now internally consistent. Formatting and naming. IdGeneration offers simple support by default. Fix exception in oracle integration test setup Use SqlIdentifier for sequence names Remove SEQUENCE id source Added documentation See #1923 Original pull request #1955
Thanks, this is merged |
Hey @schauder, @mp911de!
Hope you're doing great, I've redone the PR #1922 to make it work via a custom callback that is registered as a bean in
AbstractJdbcConfiguration
. Let me know what you think of that, thanks!CC: Targeting issue #1923