org.apache.cayenne.access.translator.batch

## Class SoftDeleteTranslatorFactory

- java.lang.Object
- - org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory
  - - org.apache.cayenne.access.translator.batch.SoftDeleteTranslatorFactory

- All Implemented Interfaces:
    BatchTranslatorFactory

      public class SoftDeleteTranslatorFactory
      extends DefaultBatchTranslatorFactory

  Implementation of {link #BatchTranslator}, which uses 'soft' delete (runs UPDATE and sets 'deleted' field to true instead-of running SQL DELETE)
  Since:
    4.0

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_DELETED_FIELD_NAME` Default name of 'deleted' field

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SoftDeleteTranslatorFactory()`
    `SoftDeleteTranslatorFactory(String deletedFieldName)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected BatchTranslator` | `deleteTranslator(DeleteBatchQuery query, DbAdapter adapter, String trimFunction)`
    `String` | `getDeletedFieldName()`

    - ### Methods inherited from class org.apache.cayenne.access.translator.batch.DefaultBatchTranslatorFactory

      `insertTranslator, translator, updateTranslator`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_DELETED_FIELD_NAME

          public static final String DEFAULT_DELETED_FIELD_NAME

      Default name of 'deleted' field
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SoftDeleteTranslatorFactory

          public SoftDeleteTranslatorFactory()

    - #### SoftDeleteTranslatorFactory

          public SoftDeleteTranslatorFactory(String deletedFieldName)

  - ### Method Detail

    - #### deleteTranslator

          protected BatchTranslator deleteTranslator(DeleteBatchQuery query,
                                                     DbAdapter adapter,
                                                     String trimFunction)

      Overrides:
        `deleteTranslator` in class `DefaultBatchTranslatorFactory`

    - #### getDeletedFieldName

          public String getDeletedFieldName()

      Returns:
        name of 'deleted' field

Copyright © 2001–2018 Apache Cayenne. All rights reserved.