[ 
https://issues.apache.org/jira/browse/OLINGO-720?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14623821#comment-14623821
 ] 

Chandan V.A edited comment on OLINGO-720 at 7/12/15 2:09 PM:
-------------------------------------------------------------

At times it is required to build custom query objects for OData's GetEntitySet, 
GetEntity, GetEntityCount, GetEntitySetCount, GetEntity before Delete and 
Update request. Currently there is no provision for applications to build 
custom query objects. In order to build custom query object applications can 
extend 

1) 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
class and implement the necessary methods in the class. If a method is not 
overriden by the inheriting class then JPA processor builds the JPA query using 
default logic.
2) Register the class as JPA entity listener with the JPA entity for which 
custom query needs to be built.
3) If the extended class supports OData Tombstone feature then return "true" 
for the method call isTombstoneSupported() else just return false.

Applications wishing to just support OData Tombstone (delta query) feature can 
extend 
org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener. 
However applications wishing to support custom JPA query and also would like to 
support OData Tombstone feature can extend 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
and return "true" for the method call isTombstoneSupported() as the class 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
extends 
org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener. 

Please Note:- A JPA entity can be registered with an entity listener that 
either extends ODataJPAQueryExtensionEntityListener or 
ODataJPATombstoneEntityListener. If a JPA entity is registered with two 
different entity listeners with one extending ODataJPATombstoneEntityListener 
and the other ODataJPAQueryExtensionEntityListener will not work as expected.

The class - 
org.apache.olingo.odata2.jpa.processor.ref.listeners.CustomerQueryExtension in 
module olingo-odata2-jpa-processor-ref provides a reference for using 
ODataJPAQueryExtensionEntityListener.
Thanks
Kind Regards
Chandan


was (Author: chandan.v.a):
At times it is required to build custom query objects for OData's GetEntitySet, 
GetEntity, GetEntityCount, GetEntitySetCount, GetEntity before Delete and 
Update request. Currently there is no provision for applications to build 
custom query objects. In order to build custom query object applications can 
extend 

1) 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
class and implement the necessary methods in the class. If a method is not 
overriden by the inheriting class then JPA processor builds the JPA query using 
default logic.
2) Register the class as JPA entity listener with the JPA entity for which 
custom query needs to be built.
3) If the extended class supports OData Tombstone feature then return "true" 
for the method call isTombstoneSupported() else just return false.

Applications wishing to just support OData Tombstone (delta query) feature can 
extend 
org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener. 
However applications wishing to support custom JPA query and also would like to 
support OData Tombstone feature can extend 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
and return "true" for the method call isTombstoneSupported() as the class 
org.apache.olingo.odata2.jpa.processor.api.ODataJPAQueryExtensionEntityListener 
extends 
org.apache.olingo.odata2.jpa.processor.api.ODataJPATombstoneEntityListener. 

Please Note:- A JPA entity can be registered with an entity listener that 
either extends ODataJPAQueryExtensionEntityListener or 
ODataJPATombstoneEntityListener. If a JPA entity is registered with two 
different entity listeners with one extending ODataJPATombstoneEntityListener 
and the other ODataJPAQueryExtensionEntityListener will not work as expected.

Thanks
Kind Regards
Chandan

> ODataJPATombstoneEntityListener does not support "count" and "GetEntity"
> ------------------------------------------------------------------------
>
>                 Key: OLINGO-720
>                 URL: https://issues.apache.org/jira/browse/OLINGO-720
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-jpa
>    Affects Versions: V2 2.0.4
>            Reporter: Christian Wilhelm
>            Assignee: Chandan V.A
>
> Hello,
> The ODataJPATombstoneEntityListener which is originally reuqired for the 
> DeltaQuerySuppoort is not listening for OData "count" operation and the 
> "GetEntity" operation.
> I am (mis-)using this listener concept for injecting a security layer - 
> therefore the two operations mentioned above should be included in the 
> ODataJPATombstoneEntityListener concept.
> Is it possible to add this function?
> Best regards,
> Christian



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to