Class ConditionalSoftDeleteDbRowOpFactory

java.lang.Object
org.apache.cayenne.access.flush.operation.ConditionalSoftDeleteDbRowOpFactory
All Implemented Interfaces:
DeleteDbRowOpFactory

public class ConditionalSoftDeleteDbRowOpFactory extends Object implements DeleteDbRowOpFactory
A DeleteDbRowOpFactory enabling "soft delete". For tables that contain a BOOLEAN column with the configured name it produces SoftDeleteDbRowOp, so the row is deleted by an UPDATE setting that column to true. Tables without such a column (or whose column of that name is not BOOLEAN) get a plain DeleteDbRowOp and are deleted with a regular SQL DELETE.
Since:
5.0
  • Constructor Details

    • ConditionalSoftDeleteDbRowOpFactory

      public ConditionalSoftDeleteDbRowOpFactory(String columnName)
  • Method Details

    • createOp

      public DeleteDbRowOp createOp(Persistent object, DbEntity entity, ObjectId id)
      Description copied from interface: DeleteDbRowOpFactory
      Creates a delete op for a given object and target table.
      Specified by:
      createOp in interface DeleteDbRowOpFactory
      Parameters:
      object - the object being deleted
      entity - the target DbEntity (may be the root table or an additional / flattened table)
      id - the id of the row being deleted
      Returns:
      a delete op