HHH-10648 : Backport corrections

This commit is contained in:
Gail Badner 2016-06-23 00:20:57 -07:00
parent 5006e92ce5
commit d407e73775
3 changed files with 5 additions and 6 deletions

View File

@ -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() );
}

View File

@ -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) {

View File

@ -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();