[hibernate-issues] [Hibernate-JIRA] Created: (HHH-6072) Logical delete support

Joonas Koivunen (JIRA) noreply at atlassian.com
Fri Apr 1 12:36:08 EDT 2011


Logical delete support
----------------------

                 Key: HHH-6072
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6072
             Project: Hibernate Core
          Issue Type: New Feature
          Components: core
            Reporter: Joonas Koivunen


Logical delete is a common pattern which hibernate could support.

While discussing this at #hibernate with sebersole some an idea of @LogicalDelete popped up. 

There was also discussion about conditional logical delete, as some applications might have business reasons to sometimes execute a logical delete, sometimes a physical delete. However as there is no simple answer to the question "what should the strategy look like" this should be scoped as a later feature issue, should @LogicalDelete get implemented.

In addition to replace @SQLDelete annotation use for logical delete, feature would also need to address:
 * SELECTs (whether to select or filter the logically deleted)
 * the used column and type for update statement
 * handling Session#delete(Object) where entity is already logically deleted
 * what happens to entity owned collections
 * could/should the logical delete be cascadable?
 * could undelete be handled in a way other than native sql update?

SELECTs could be either done with a pre-existing solution, which must be in use already where hibernate is used to logically delete entities and not to query them as normal entities. sebersole pointed out that full support for @LogicalDelete could implement this in a more integrated way.

The used column and type must be configurable, simple boolean was suggested; inhouse we use a timestamp.

Attempting to delete an already deleted entity should be treated as an error.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list