[ 
https://issues.apache.org/jira/browse/CAY-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andrus Adamchik updated CAY-2969:
---------------------------------
    Description: 
Let's make soft delete more convenient to configure via an extender API:
{noformat}
CoreModule.extend(b).useSoftDeleteIfColumnPresent("db_attribute_name");{noformat}
And use this opportunity to rework the backend, treating soft delete as a 
first-class citizen during batch generation on commit instead of the current 
hack with delete batch interception.

_This will make the feature work better, but it is still not fully native. In 
the future we may improve it in the following ways:_
 * _Automatically and implicitly add a qualifier to each soft-delete entity to 
filter out soft-deleted columns_
 * _Allow to pick a single column in the entity as "soft delete" column, 
helping the Modeler to exclude it from ObjAttributes_

  was:
Let's make soft delete more convenient to configure via an extender API:
{noformat}
CoreModule.extend(b).useSoftDeleteIfColumnPresent("db_attribute_name");{noformat}
And use this opportunity to rework the backend, treating soft delete as a 
first-class citizen during batch generation on commit instead of the current 
hack with delete batch interception.

User recommendation: do not map the delete column ("db_attribute_name" in the 
example above) as an ObjAttribute.

TODO:
 * in the future, maybe we can make the deleted flag a part of DbAttribute, and 
then the Modeler would assist in making the right mapping decision
 * we can also automatically and implicitly add a qualifier to the entity to 
filter out soft-deleted columns


> Make "soft" delete the first-class citizen
> ------------------------------------------
>
>                 Key: CAY-2969
>                 URL: https://issues.apache.org/jira/browse/CAY-2969
>             Project: Cayenne
>          Issue Type: Task
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Major
>             Fix For: 5.0-M3
>
>
> Let's make soft delete more convenient to configure via an extender API:
> {noformat}
> CoreModule.extend(b).useSoftDeleteIfColumnPresent("db_attribute_name");{noformat}
> And use this opportunity to rework the backend, treating soft delete as a 
> first-class citizen during batch generation on commit instead of the current 
> hack with delete batch interception.
> _This will make the feature work better, but it is still not fully native. In 
> the future we may improve it in the following ways:_
>  * _Automatically and implicitly add a qualifier to each soft-delete entity 
> to filter out soft-deleted columns_
>  * _Allow to pick a single column in the entity as "soft delete" column, 
> helping the Modeler to exclude it from ObjAttributes_



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to