Class ODataJPATombstoneEntityListener
- java.lang.Object
-
- org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener
-
- Direct Known Subclasses:
ODataJPAQueryExtensionEntityListener
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 Description ODataJPATombstoneEntityListener()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddToDelta(Object entity, String entityName)abstract StringgenerateDeltaToken(List<Object> deltas, javax.persistence.Query query)Implement this method to create a delta token.abstract javax.persistence.QuerygetQuery(GetEntitySetUriInfo resultsView, javax.persistence.EntityManager em)Implement this method to create aQueryobject.booleanisTombstoneSupported()Implement this method to indicate whether the extended class can handle OData Tombstone feature as well
-
-
-
Method Detail
-
getQuery
public abstract javax.persistence.Query getQuery(GetEntitySetUriInfo resultsView, javax.persistence.EntityManager em) throws ODataJPARuntimeException
Implement this method to create aQueryobject. 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 requestem- is a reference toEntityManager- Returns:
- an instance of type
Query - Throws:
ODataJPARuntimeException- Caso ocorra exceção
-
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 Entitiesquery- is an instance of typeQuerythat 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
-
-