3

I am using Olingo 1.2 on top of Hibernate.

I have a request that returns 250 rows, each row links to another table in a one-to-many relationship.

I execute $expand to get all data in the child table, but when I examine the query executed in the database it appears that there are 251 individual calls being made, one for the master table returning 250 rows, and then one for each of the rows to return the child records.

Looking at the Olingo code, this lazy approach is by design.

I've test $expand on Microsoft ODATA processor and they use a greedy approach in this case.

My Question is: How can I switch Olingo to use a greedy approach for $expand (i.e. push the join down into the database)?

1 Answers1

0

The queries that you are seeing generated are a result of Hibernate, not Olingo. This is the default way that Hibernate uses to generate queries for the child table. You need to look at the @Fetch(FetchMode.Join) annotation in Hibernate and apply it to your relation. Please take a look at this link for the explanation:

https://stackoverflow.com/a/11077041/3873392

Community
  • 1
  • 1
iJK
  • 11
  • 2