HHH-3980 - Fix for HHH-2980 introduced bug that allows the same bag collection role to be fetched multiple times
git-svn-id: https://svn.jboss.org/repos/hibernate/core/branches/Branch_3_3@16875 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
2961dbf9d1
commit
0d4aa2c1f9
|
@ -24,8 +24,8 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.loader;
|
package org.hibernate.loader;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.List;
|
||||||
import java.util.HashSet;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.hibernate.engine.SessionFactoryImplementor;
|
import org.hibernate.engine.SessionFactoryImplementor;
|
||||||
import org.hibernate.persister.entity.Loadable;
|
import org.hibernate.persister.entity.Loadable;
|
||||||
|
@ -70,14 +70,14 @@ public abstract class BasicLoader extends Loader {
|
||||||
}
|
}
|
||||||
|
|
||||||
CollectionPersister[] collectionPersisters = getCollectionPersisters();
|
CollectionPersister[] collectionPersisters = getCollectionPersisters();
|
||||||
Set bagRoles = null;
|
List bagRoles = null;
|
||||||
if ( collectionPersisters != null ) {
|
if ( collectionPersisters != null ) {
|
||||||
String[] collectionSuffixes = getCollectionSuffixes();
|
String[] collectionSuffixes = getCollectionSuffixes();
|
||||||
collectionDescriptors = new CollectionAliases[collectionPersisters.length];
|
collectionDescriptors = new CollectionAliases[collectionPersisters.length];
|
||||||
for ( int i = 0; i < collectionPersisters.length; i++ ) {
|
for ( int i = 0; i < collectionPersisters.length; i++ ) {
|
||||||
if ( isBag( collectionPersisters[i] ) ) {
|
if ( isBag( collectionPersisters[i] ) ) {
|
||||||
if ( bagRoles == null ) {
|
if ( bagRoles == null ) {
|
||||||
bagRoles = new HashSet();
|
bagRoles = new ArrayList();
|
||||||
}
|
}
|
||||||
bagRoles.add( collectionPersisters[i].getRole() );
|
bagRoles.add( collectionPersisters[i].getRole() );
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
package org.hibernate.loader;
|
package org.hibernate.loader;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.List;
|
||||||
|
|
||||||
import org.hibernate.HibernateException;
|
import org.hibernate.HibernateException;
|
||||||
|
|
||||||
|
@ -34,19 +34,19 @@ import org.hibernate.HibernateException;
|
||||||
* @author Steve Ebersole
|
* @author Steve Ebersole
|
||||||
*/
|
*/
|
||||||
public class MultipleBagFetchException extends HibernateException {
|
public class MultipleBagFetchException extends HibernateException {
|
||||||
private final Set bagRoles;
|
private final List bagRoles;
|
||||||
|
|
||||||
public MultipleBagFetchException(Set bagRoles) {
|
public MultipleBagFetchException(List bagRoles) {
|
||||||
super( "cannot simultaneously fetch multiple bags" );
|
super( "cannot simultaneously fetch multiple bags" );
|
||||||
this.bagRoles = bagRoles;
|
this.bagRoles = bagRoles;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the set of collection roles for the bags encountered.
|
* Retrieves the collection-roles for the bags encountered.
|
||||||
*
|
*
|
||||||
* @return The bag collection roles.
|
* @return The bag collection roles.
|
||||||
*/
|
*/
|
||||||
public Set getBagRoles() {
|
public List getBagRoles() {
|
||||||
return bagRoles;
|
return bagRoles;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue