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
127 stars 79 forks source link

Odata function using java classes does not support $expand. #71

Closed taj499 closed 11 months ago

taj499 commented 5 years ago

I created Odata function which returns collection of entity A (let say). Entity A has collection of children entity B. I am able to generate metadata document. Odata function call is working. But, ../function()?$expand=B is not working properly. It does not given me error. It just does not expand B.

I think, it should support $expand when function returns collection of enitity.

taj499 commented 5 years ago

As per my analysis, JPAEntityResultConverter should handle navigation properties along with entity properties to make it work. Entity class should have navigation link to support $expand.

wog48 commented 5 years ago

As of now $expand is not supported together with functions, so at least a status code 501 is missing. Introducing this is laborious, as the current mechanism using sub-selects to restrict the rows of dependent table (in your example B) to the once needed. In case the JPA Processor would do the expand it would need to provide also an $expand that selects the dependent rows via the key. Alternatively this could be handled within the function itself and then, as you mentioned, the JPAEntityResultConverter needs to be able convert a deep result.

As a first step a 501 will be returned. In a later step an option will be created handle $expand at a function

ozcanmelih commented 1 year ago

Are there any plans to implement this functionality soon?

wog48 commented 1 year ago

As of now there was no plan to implement this. Nevertheless, as different types of functions are supported yet, which may offer different ways to implement an expand. Therefor I like to know if you implement the function on the database or in java.

wog48 commented 11 months ago

Due to clean-up action. All issues created before 2022 get closed.