-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add support for soft deletes [DATAJPA-307] #676
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
Comments
Dev Naruka commented I saw that there is some activity towards implementing soft delete using the query augmentation. Generally a delete has the following impacts:
And soft delete changes the delete action in the following ways:
So, the infrastructure is already there to do the first two points. Have anybody planned SOFT-DELETE Cascade yet? or more generically infrastructure level support for providing an opportunity to query augmentors to augment query during a CASCADE. If not, then I would like to volunteer for the same. However, I have already started on Querydsl Soft Delete filters and would be doing the native query augmentation also, but it would be great has some foresight on the cascade mechanism |
Rob Maskell commented I'd like to test this and tried adding the following to my build.gradle ext['spring-data.commons.version'] = '1.11.0.DATACMNS-293-SNAPSHOT'
ext['spring-data.jpa.version'] = '1.9.0.DATAJPA-307-SNAPSHOT' but it didn't pull in the correct dependencies, I'm using the 1.3 milestone release of spring boot, what did I do wrong? |
Jack Matthews commented Can I just suggest something else that would be great with this feature, that is the ability to query all records in certain situations. In my case I have a requirement to make records active/inactive (which for all intensive purposes inactive=deleted). However, the user has the ability to reactivate (undelete) a records at any time from a management screen. So everywhere in the application the soft delete filter should filter the inactive records out of the queries except on a single administration screen whereby the user can toggle the active flag on the record. I am thinking an annotation on the spring-data-jpa query might be the way to go. @IncludeDeleted <---------------- This annotation could disable the soft delete filtering
@Query('select from account')
private List<Account> findAllIncludingDeleted(); |
Raúl Gomis commented Oliver, any update on this feature? are you still planning to introduce it? |
alx tr commented Indeed, what happened with this feature? |
swxu2005 commented Eagerly look forward to this feature, will it come out in Lovelace GA? |
nowakprojects commented Oliver Drotbohm What about this feature? Is there any hope? |
SayakMukhopadhyay commented This issue is being shelved for more than 5 years now. Can we please have a concrete timeline for this? It would help us decide whether to spin our own solution or wait for the official release |
Tasos Zervos commented To add to the last comment. This is probably one of these low priority (and probably tricky) features. But I'd like you to make a decision whether you are seriously planning to support it or if not state that you won't. Just that. People, groups, companies can then make their minds whether they really need this feature (and do something about it, like the last comment suggested) or come up with different ways to achieve the same goals as with soft deletes |
It's been almost eight years. When will the feature be officially released. |
Once one starts to look into this in detail it becomes really complex. You can implement this using native Hibernate features though. Search for "Hibernate soft deletes" in your preferred search engine. See for reference: spring-projects/spring-data-commons#766 (comment) We might also consider building an example how this could be achieved in order to explore the limitations. See #2163 |
Having also looked at this, I don't think framework should handle it. It's best handled out of band. |
Oliver Drotbohm opened DATAJPA-307 and commented
Issue Links:
DATAJPA-1551 Create an API to customize query creation and query processing
DATAMONGO-1151 Introduce ability to append queries against a particular collection
DATACMNS-293 Add infrastructure for generic query augmentation
Referenced from: pull request #48
74 votes, 64 watchers
The text was updated successfully, but these errors were encountered: