Re: Non-physical delete... again

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Tue Jun 02 2009 - 05:08:53 EDT

  • Next message: Aristedes Maniatis: "Re: Non-physical delete... again"

    Hi,

    > Back then, we
    > could set up a delegate to intercept all queries, and I automatically
    > added the restricting qualifier to each select query.

    I'm afraid, simple qualifier would not be enough, I need to set them for all
    joined tables in query (I have simple qualifirer already, by using ObjEntity
    qualifier).

    2009/6/1 Andrus Adamchik <andru..bjectstyle.org>
    >
    >
    > On Jun 1, 2009, at 6:09 PM, Andrey Razumovsky wrote:
    >
    >>
    >>
    >> 2. Deletion strategy for DataDomain. This means I do not always fire
    >> DeleteAction, but maybe something else (update action in my case).
    >>
    >
    > Yeah, good idea to move this down the stack. I would love to have the
    > ObjectContext level code to stay unchanged, but then generate UPDATE instead
    > of DELETE at the lower levels if entity is tagged as "soft delete".

    I actually want to see this more generic, i.e. DeletionStrategy interface
    with one default implementation (which fires DELETE) and ability to set my
    own.

    >
    >
    > 1. DBEntity qualifier. This is same as ObjEntity qualifier, but applied
    >> every time DBentity is being added to select sql. I will add DBEntity
    >> qualifier 'deleted=false' and drop current ObjEntity's
    >>
    >
    > So does that mean dropping ObjEntity qualifiers completely? (This may or
    > may not be a good idea, I am not yet sure myself).

    I mean removing them in my Cayenne project of course, not in API.

    > Also I think there's a possibility here to address another annoyance in one
    > shot - the need to manually set the inheritance discriminator column for new
    > objects when inheritance is used. If we can add functionality to expressions
    > to not only "get" the value from an object, but also "set" the value, we can
    > do both soft delete and auto inheritance update based on an (almost)
    > arbitrary exception. Kind of like OGNL framework does...
    >
    >
    Well, I agree this is must-have in Cayenne. But my proposed solution is a
    separate feature, because I need intercepting at DbEntity level.

    If noone minds against these features, I think I'll look at implementing
    'DeleteStrategy' and 'DbEntity qualifiers'

    Andrey



    This archive was generated by hypermail 2.0.0 : Tue Jun 02 2009 - 05:09:30 EDT