HHH-1283 : Join fetched collections using Query.scroll() is correct only for first entity
This commit is contained in:
parent
8eb7d8cf64
commit
3a72b45325
|
@ -395,7 +395,7 @@ public abstract class Loader {
|
|||
}
|
||||
}
|
||||
while ( resultSet.next() &&
|
||||
keyToRead.equals( getKeyFromResultSet( 0, getEntityPersisters()[0], null, resultSet, session ) ) );
|
||||
isCurrentRowForSameEntity( keyToRead, 0, resultSet, session ) );
|
||||
}
|
||||
catch ( SQLException sqle ) {
|
||||
throw factory.getSQLExceptionHelper().convert(
|
||||
|
@ -415,6 +415,17 @@ public abstract class Loader {
|
|||
return result;
|
||||
}
|
||||
|
||||
private boolean isCurrentRowForSameEntity(
|
||||
final EntityKey keyToRead,
|
||||
final int persisterIndex,
|
||||
final ResultSet resultSet,
|
||||
final SessionImplementor session) throws SQLException {
|
||||
EntityKey currentRowKey = getKeyFromResultSet(
|
||||
persisterIndex, getEntityPersisters()[persisterIndex], null, resultSet, session
|
||||
);
|
||||
return keyToRead.equals( currentRowKey );
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a single logical row from the result set moving forward. This is the
|
||||
* processing used from the ScrollableResults where there were collection fetches
|
||||
|
|
Loading…
Reference in New Issue