Created OData Java function which returns collection of entity X. Entity X has one-to-many relationship - entity Y. Java function call is working. But, ../function()?$expand=Y is not working properly because Y is coming empty even relationship data exists in Y:
This is the request:
.../odata/v1/function(pk='1')?$format=application/json;odata.metadata=full&$expand=Y
here is the response:
{
"@odata.context": "http://localhost:8000/odata/v1/$metadata#Collection(com.odata4.X)(Y())",
"value": [
{
"@odata.type": "#com.odata4.X",
"@odata.id": "'1'",
"Column": "Name",
"Y": []
}
]
}
It should support $expand - I can see in debugger than Y is populated but relationship is not processed by JPAOperationRequestProcessor.java