In Java I want to create a tree like this: You enter a searchcode of a CI. Then should all relations be found (in one direction, so that it is a tree and not a graph). The first time I tested it, I did it - in a bad style - directly with a query to the database without the webapi. This worked well (fast and correct). In a second way I want to do the same query with the webapi, but this doesn't work. The tree is not complete, some CI's and relations are missing. Another problem that emerged from using the webapi: The query takes about minutes instead of seconds (compared to the time it was used by the direct access to the database). That can't be correct.
Please help me, my code is in attachment (the method getData):