org.apache.olingo.odata2.jpa.processor.api

## Class ODataJPATombstoneEntityListener

- java.lang.Object
- - org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener

- Direct Known Subclasses:
    ODataJPAQueryExtensionEntityListener, SalesOrderItemTombstoneListener, SalesOrderTombstoneListener

      public abstract class ODataJPATombstoneEntityListener
      extends Object

  Extend this class and implement a JPA Entity Listener as specified in JSR 317 Java Persistence 2.0. The class provides abstract methods that shall be implemented by JPA application to handle OData Tombstone features. The implemented JPA Entity Listener classes will be called back from OData JPA Processor Library.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ODataJPATombstoneEntityListener()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addToDelta(Object entity, String entityName)`
    `abstract String` | `generateDeltaToken(List<Object> deltas, javax.persistence.Query query)` Implement this method to create a delta token.
    `abstract javax.persistence.Query` | `getQuery(GetEntitySetUriInfo resultsView, javax.persistence.EntityManager em)` Implement this method to create a `Query` object.
    `boolean` | `isTombstoneSupported()` Implement this method to indicate whether the extended class can handle OData Tombstone feature as well

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

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

- - ### Constructor Detail

    - #### ODataJPATombstoneEntityListener

          public ODataJPATombstoneEntityListener()

  - ### Method Detail

    - #### addToDelta

          protected final void addToDelta(Object entity,
                                          String entityName)

    - #### getQuery

          public abstract javax.persistence.Query getQuery(GetEntitySetUriInfo resultsView,
                                                           javax.persistence.EntityManager em)
                                                    throws ODataJPARuntimeException

      Implement this method to create a `Query` object. The Query object can be created from OData requests. The query instance thus created can be used for handling delta JPA entities. The delta token passed from OData request can be accessed from `com.sap.core.odata.processor.api.jpa.ODataJPATombstoneContext`.
      Parameters:
        `resultsView` - is a reference to OData request
        `em` - is a reference to `EntityManager`
      Returns:
        an instance of type `Query`
      Throws:
        `ODataJPARuntimeException`

    - #### generateDeltaToken

          public abstract String generateDeltaToken(List<Object> deltas,
                                                    javax.persistence.Query query)

      Implement this method to create a delta token.
      Parameters:
        `deltas` - is list of delta JPA Entities
        `query` - is an instance of type `Query` that was used for handling delta entites
      Returns:
        a delta token of type String

    - #### isTombstoneSupported

          public boolean isTombstoneSupported()

      Implement this method to indicate whether the extended class can handle OData Tombstone feature as well
      Returns:
        true by default

Copyright © 2013-2023 The Apache Software Foundation. All Rights Reserved.