KODO 4.2 EAGER FECHING NOT QUERYING EFFICIENTLY WITH ONE-TO-ONE-TO-MANY RELATION
(Doc ID 1122843.1)
Last updated on MARCH 09, 2019
Applies to:Oracle Kodo - Version 4.1 and later
Information in this document applies to any platform.
Kodo 4.2 JDO.
If you have a one-to-one-to-many relationship A(1) --> B(1) --> C(*), for example, (1)Parent -> (1) Child --> (*) Friend, when eager fetching this object graph the SQL generated is inefficient. In the test case eager fetching was defined programmatically. For example:
If we run an eager query on this object graph by requesting the 'Parent', Kodo generates a SQL statement to get all of the Parents, a statement to get all of the 'Child' objects, and then one statement for each 'Child' object to get the Friends. For example, for each Child object, there is a statement like:
? ORDER BY t0.ORDR ASC [params=(long) 51]
SELECT t0.ORDR, t0.ID, t0.VERSION, t0.CHILD FROM FRIEND t0 WHERE t0.CHILD =
? ORDER BY t0.ORDR ASC [params=(long) 201]
With a workaround (see below), it is possible to get all of the Friend objects with a single statement:
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document