HHH-10648 : Backport corrections
This commit is contained in:
parent
5006e92ce5
commit
d407e73775
|
@ -171,7 +171,7 @@ public abstract class AbstractLoadQueryDetails implements LoadQueryDetails {
|
|||
}
|
||||
|
||||
if ( fetchStats != null && fetchStats.getJoinedBagAttributeFetches().size() > 1 ) {
|
||||
final List<String> bagRoles = new ArrayList<>();
|
||||
final List<String> bagRoles = new ArrayList<String>();
|
||||
for ( CollectionAttributeFetch bagFetch : fetchStats.getJoinedBagAttributeFetches() ) {
|
||||
bagRoles.add( bagFetch.getCollectionPersister().getRole() );
|
||||
}
|
||||
|
|
|
@ -673,7 +673,7 @@ public class LoadQueryJoinAndFetchProcessor {
|
|||
}
|
||||
if ( isJoinFetchedBag( fetch ) ) {
|
||||
if ( joinedBagAttributeFetches == null ) {
|
||||
joinedBagAttributeFetches = new HashSet<>();
|
||||
joinedBagAttributeFetches = new HashSet<CollectionAttributeFetch>();
|
||||
}
|
||||
joinedBagAttributeFetches.add( (CollectionAttributeFetch) fetch );
|
||||
}
|
||||
|
@ -685,8 +685,9 @@ public class LoadQueryJoinAndFetchProcessor {
|
|||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({"unchecked"})
|
||||
public Set<CollectionAttributeFetch> getJoinedBagAttributeFetches() {
|
||||
return joinedBagAttributeFetches == null ? Collections.emptySet() : joinedBagAttributeFetches;
|
||||
return joinedBagAttributeFetches == null ? Collections.EMPTY_SET : joinedBagAttributeFetches;
|
||||
}
|
||||
|
||||
private boolean isJoinFetchedBag(Fetch fetch) {
|
||||
|
|
|
@ -73,10 +73,8 @@ public class MultipleBagFetchHqlTest extends BaseCoreFunctionalTestCase {
|
|||
.uniqueResult();
|
||||
fail("Should throw org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags");
|
||||
}
|
||||
catch ( IllegalArgumentException expected ) {
|
||||
catch ( MultipleBagFetchException expected ) {
|
||||
session.getTransaction().rollback();
|
||||
// MultipleBagFetchException was converted to IllegalArgumentException
|
||||
assertTrue( MultipleBagFetchException.class.isInstance( expected.getCause() ) );
|
||||
}
|
||||
finally {
|
||||
session.close();
|
||||
|
|
Loading…
Reference in New Issue