-
Notifications
You must be signed in to change notification settings - Fork 30
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
Return the CrudRepository method with the insert and update methods #284
Conversation
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
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'm fine with the approach of moving the insert and update methods to a CrudRepository rather than having them on BasicRepository. However, I don't agree with changing their return types. Not needing to fetch the entities is one of the distinctions that these patterns have that make them different from save/saveAll which already offers that ability.
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
Signed-off-by: Otavio Santana <[email protected]>
let's take a step back:
If I want to explicitly insert and update I should use those methods instead of "save". Does it make sense? |
@otaviojava It's fine to make things unsupported where the database isn't capable of it, but the user needs to be able to rely on guarantees. Using ambiguous language as is added under e52fbce and 56b7c42 will deprive them of the ability to rely on what the method does and make it useless. Could you revert those commits and not write it in terms of "might work for relational databases". Relational databases shouldn't be mentioned at all since some other databases can be capable of the same. Instead, specifically call out what types of databases are not capable as raising UnsupportedOperationException. |
Your summary here sounds great. It's your changes in the pull regarding return types that aren't consistent with it. There is nothing about create/insert and update that should involve fetching entities. |
hum, I got it. Could you help me to write this point? Those databases can insert and update but using BASE instead of ACID. In theory, both can use those methods, however, with different data consistency models. We also have append model, it is inserting and updating, but different from SQL... |
@njr-11 |
How about using divide-and-conquer strategy in an even more fine grained way? In this pull, only move the methods to CrudRepository without changing the return types. We can all approve that and merge it. |
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
Co-authored-by: Nathan Rauh <[email protected]>
…sitory Signed-off-by: Otavio Santana <[email protected]>
@njr-11 So, the next one will be hard. |
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.
This looks good now. We can discuss the related topics that came up in separate issues.
Changes