TreePrinterHelper.INSTANCE.generateNodePrefix( depth+3 ) + "suffixed key columns - " + String.join( ", ", collectionReferenceAliases.getCollectionColumnAliases().getSuffixedKeyAliases() ) ); final EntityReferenceAliases elementAliases = collectionReferenceAliases.getEntityElementAliases();
TreePrinterHelper.INSTANCE.generateNodePrefix( depth + detailDepthOffset ) + "suffixed key columns - {" + String.join( ", ", collectionReferenceAliases.getCollectionColumnAliases().getSuffixedKeyAliases() ) + "}" );
descriptor.getSuffixedKeyAliases(), session );
final Serializable collectionRowKey = (Serializable) collectionReference.getCollectionPersister().readKey( resultSet, aliases.getCollectionColumnAliases().getSuffixedKeyAliases(), context.getSession() );
final Serializable collectionRowKey = (Serializable) persister.readKey( rs, descriptor.getSuffixedKeyAliases(), session );
descriptor.getSuffixedKeyAliases(), session );
private void preLoadBatchFetchingQueue(SharedSessionContractImplementor session, TupleAsMapResultSet resultset) { // Logic to eliminate the n+1 issue in collection loading when batch fetching is enabled. // // Walk the resultset to hydrate the collection elements. // Hydrating will add associated entities to the batch fetching queue without loading them. // The next resultset walking will effectively load these associated entities // but with the help of the properly loaded batch fetching queue. // Without this double phase, each element is individually loaded leading to n+1 // because the batch fetching queue does not contain the "next" elements. try { while ( resultset.next() ) { // Call hydrate on the collection element itself // This is too much work as we are only interested in ToOne hydration // But ToOne can be contained in ComponentType // TODO: only call this hydration phase if we know that the collection contains directly or indirectly ToOnes Tuple tuple = resultset.unwrap( TupleAsMapResultSet.class ).getTuple(); collectionPersisters[0].getElementGridType().hydrate( tuple, collectionAliases[0].getSuffixedElementAliases(), session, null ); // a key might exist and might be an entity (not currently supported though in OGM) if ( collectionPersisters[0].getKeyColumnNames().length > 0 ) { collectionPersisters[0].getKeyGridType() .hydrate( tuple, collectionAliases[0].getSuffixedKeyAliases(), session, null ); } } // reset resultset for main loop resultset.beforeFirst(); } catch (SQLException e) { //never happens this is not a regular ResultSet } }
descriptor.getSuffixedKeyAliases(), session );
descriptor.getSuffixedKeyAliases(), session );
descriptor.getSuffixedKeyAliases(), session );