soft-delete

Hibernate: Overwrite sql-delete with inheritace

谁说我不能喝 提交于 2019-11-27 18:49:23
问题 I have an entity A and B extends A and try to have a soft-delete with joined inheritance strategy. @Entity @Inheritance(strategy = InheritanceType.JOINED) @SQLDelete("UPDATE A SET deleted = 1 WHERE id = ?") A { @Id long id; boolean deleted; } @Entity B extends A {} It seems that Hibernate properly sets the table A to deleted = 1 , but also deletes the whole entry from table B . I would, of course, like to preserve this entry. Any ideas on that? I'm using Hibernate 3.5.5 and annotation-based

Disable SoftDelete for AbpUserRole

一世执手 提交于 2019-11-27 07:40:11
问题 By default, the AbpUserRole and AbpRole implement ISoftDelete . Is it possible to disable it? I tried to do this: [AbpAuthorize(AppPermissions.Pages_Administration_Roles_Delete)] public async Task DeleteRole(EntityDto input) { using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete)) { var role = await _roleManager.GetRoleByIdAsync(input.Id); var users = await UserManager.GetUsersInRoleAsync(role.Name); foreach (var user in users) { CheckErrors(await UserManager.RemoveFromRoleAsync

ExpressionVisitor soft delete

╄→гoц情女王★ 提交于 2019-11-27 06:26:47
问题 We're having some issues implementing soft delete functionality with entity framework. The idea is to use a repository which is aware of the EF context. On the level of the repository we implemented a plugin system, these plugins get executed whenever an action is done on the repository. For example when we call Repository.GetQuery<Relation>() the plugins get executed. One of the plugins is a LogicalDeletePlugin , this plugin should add a Where(x => x.IsDeleted) statement to each table which

Soft delete best practices (PHP/MySQL)

余生颓废 提交于 2019-11-26 15:48:25
问题 Problem In a web application dealing with products and orders, I want to maintain information and relationships between former employees (users) and the orders they handled. I want to maintain information and relationships between obsolete products and orders which include these products. However I want employees to be able to de-clutter the administration interfaces, such as removing former employees, obsolete products, obsolete product groups etc. I'm thinking of implementing soft-deletion.

Physical vs. logical / soft delete of database record?

爱⌒轻易说出口 提交于 2019-11-26 14:11:44
What is the advantage of doing a logical/soft delete of a record (i.e. setting a flag stating that the record is deleted) as opposed to actually or physically deleting the record? Is this common practice? Is this secure? Advantages are that you keep the history (good for auditing) and you don't have to worry about cascading a delete through various other tables in the database that reference the row you are deleting. Disadvantage is that you have to code any reporting/display methods to take the flag into account. As far as if it is a common practice - I would say yes, but as with anything

Are soft deletes a good idea? [duplicate]

流过昼夜 提交于 2019-11-26 12:38:28
This question already has an answer here: Physical vs. logical / soft delete of database record? 22 answers Are soft deletes a good idea or a bad idea? Instead of actually deleting a record in your database, you would just flag it as IsDeleted = true , and upon recovery of the record you could just flag it as False . Is this a good idea? Is it a better idea to physically delete the record, then move it to an archive database, and if the user wants the record back, then software will look for the record in the archive and recreate it? I say it's a bad idea, generally (with some exceptions,

Physical vs. logical / soft delete of database record?

会有一股神秘感。 提交于 2019-11-26 03:48:28
问题 What is the advantage of doing a logical/soft delete of a record (i.e. setting a flag stating that the record is deleted) as opposed to actually or physically deleting the record? Is this common practice? Is this secure? 回答1: Advantages are that you keep the history (good for auditing) and you don't have to worry about cascading a delete through various other tables in the database that reference the row you are deleting. Disadvantage is that you have to code any reporting/display methods to

Are soft deletes a good idea? [duplicate]

耗尽温柔 提交于 2019-11-26 02:27:06
问题 This question already has an answer here: Physical vs. logical / soft delete of database record? 24 answers Are soft deletes a good idea or a bad idea? Instead of actually deleting a record in your database, you would just flag it as IsDeleted = true , and upon recovery of the record you could just flag it as False . Is this a good idea? Is it a better idea to physically delete the record, then move it to an archive database, and if the user wants the record back, then software will look for