Hello, I am trying to understand how hibernate works behind the scenes concerning for each loops. I am able to retrieve and iterate a list of objects with little overhead but when I start a nested loop that iterates a list of objects that is an attribute of the original object, the performance degrades substantially even if there are only two elements in the list. I was looking for any suggestions for perhaps improving this or an explanation of how hibernate handles loops?
for ( CriteriaSet scs : setsWithRegisteredCriteria ) { // this iterates 13k objects with no problem List<CriteriaObj> searchCrit = scs.getSearchItems(); for ( CriteriaObj searchCriteria : searchCrit ) { // This loop instantly adds significant time even if there is only one item in the searchCrit list } }
Thanks
|