private List < DBEntity > collectUninitializedEntities ( DBEntity entity , final String category , final TableDefinition tableDef , final List < String > fields , final String link , final Map < ObjectID , LinkList > cache , final Set < ObjectID > keys , final DBEntitySequenceOptions options ) { DBEntityCollector collector = new DBEntityCollector ( entity ) { @ Override protected boolean visit ( DBEntity entity , List < DBEntity > list ) { if ( entity . findIterator ( category ) == null ) { ObjectID id = entity . id ( ) ; LinkList columns = cache . get ( id ) ; if ( columns == null ) { keys . add ( id ) ; list . add ( entity ) ; return ( keys . size ( ) < options . initialLinkBufferDimension ) ; } DBLinkIterator linkIterator = new DBLinkIterator ( entity , link , columns , m_options . linkBuffer , DBEntitySequenceFactory . this , category ) ; entity . addIterator ( category , new DBEntityIterator ( tableDef , entity , linkIterator , fields , DBEntitySequenceFactory . this , category , m_options ) ) ; } return true ; } } ; return collector . collect ( ) ; }
Collects the entities to be initialized with the initial list of links using the link list bulk fetch . Visits all the entities buffered by the iterators of the same category .