SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 77 forks source link

JPAODataClaimsProvider is not supporting count entities queries #69

Closed taj499 closed 5 years ago

taj499 commented 5 years ago

Hi,

I am exploring JPA processor api. I found that JPAODataClaimsProvider is not supporting count entities query. i checked the code. here, purposefully you are not passing JPAODataClaimsProvider to JPAJoinQuery. Any issue with that?

Thanks

wog48 commented 5 years ago

I had a look at the code. JPACountRequestProcessor does not forward the claims when it creates an instance of JPAJoinQuery, method countEntities.

If my first analysis is correct the problem only occurs in case you make a queries like .../<EntitySet>/$count. In case you make inline count so a query like .../<EntitySet>?$count=true the claims should be taken into account.

taj499 commented 5 years ago

Thanks for reply.

I actually tried it with .../?$count=true and it is not working. One of the JPAJoinQuery constructor, it has below given code which is the issue. this.claimsProvider = Optional.empty();

I hope, it will help you.

wog48 commented 5 years ago

Thanks for the check. This Indicates that more tests are missing than I have expected. I will work on that issue as soon as I have finished the one I'm currently working on

wog48 commented 5 years ago

@taj499 Have had a look at the latest version? It should solve the problem.

taj499 commented 5 years ago

it looks good. now, issue Fixed. Thanks.