HHH-6497 : Update AbstractEntityPersister to use AssociationAttributeBinding.getCascadeStyle() and getFetchMode()

This commit is contained in:
Gail Badner 2011-07-27 13:58:30 -07:00
parent e1f7ee8e0f
commit b2692620d7
1 changed files with 11 additions and 6 deletions

View File

@ -95,6 +95,7 @@ import org.hibernate.mapping.PersistentClass;
import org.hibernate.mapping.Property; import org.hibernate.mapping.Property;
import org.hibernate.mapping.Selectable; import org.hibernate.mapping.Selectable;
import org.hibernate.metadata.ClassMetadata; import org.hibernate.metadata.ClassMetadata;
import org.hibernate.metamodel.binding.AssociationAttributeBinding;
import org.hibernate.metamodel.binding.AttributeBinding; import org.hibernate.metamodel.binding.AttributeBinding;
import org.hibernate.metamodel.binding.EntityBinding; import org.hibernate.metamodel.binding.EntityBinding;
import org.hibernate.metamodel.binding.SimpleValueBinding; import org.hibernate.metamodel.binding.SimpleValueBinding;
@ -1038,12 +1039,16 @@ public abstract class AbstractEntityPersister
propColumnNumbers.add( colnos ); propColumnNumbers.add( colnos );
propFormulaNumbers.add( formnos ); propFormulaNumbers.add( formnos );
// TODO: fix this when HHH-6357 is fixed; for now, assume FetchMode.DEFAULT if ( singularAttributeBinding.isAssociation() ) {
//joinedFetchesList.add( singularAttributeBinding.getValue().getFetchMode() ); AssociationAttributeBinding associationAttributeBinding =
joinedFetchesList.add( FetchMode.DEFAULT ); ( AssociationAttributeBinding ) singularAttributeBinding;
// TODO: fix this when HHH-6355 is fixed; for now assume CascadeStyle.NONE cascades.add( associationAttributeBinding.getCascadeStyle() );
//cascades.add( singularAttributeBinding.getCascadeStyle() ); joinedFetchesList.add( associationAttributeBinding.getFetchMode() );
cascades.add( CascadeStyle.NONE ); }
else {
cascades.add( CascadeStyle.NONE );
joinedFetchesList.add( FetchMode.SELECT );
}
} }
subclassColumnClosure = ArrayHelper.toStringArray( columns ); subclassColumnClosure = ArrayHelper.toStringArray( columns );