From fc942278cc25a7b3bfa96513c4d20d0baeed3331 Mon Sep 17 00:00:00 2001 From: Hardy Ferentschik Date: Tue, 17 May 2011 12:19:44 +0200 Subject: [PATCH] HHH-6230 Fixing wrong usage of equals. A string was compared against an enum --- .../state/binding/HbmPluralAttributeBindingState.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/state/binding/HbmPluralAttributeBindingState.java b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/state/binding/HbmPluralAttributeBindingState.java index 9e3775547c..222a8f1354 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/state/binding/HbmPluralAttributeBindingState.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/source/hbm/state/binding/HbmPluralAttributeBindingState.java @@ -69,7 +69,9 @@ public class HbmPluralAttributeBindingState extends AbstractHbmAttributeBindingS collection.isOptimisticLock() ); this.collection = collection; - this.collectionPersisterClass = MappingHelper.classForName( collection.getPersister(), getDefaults().getServiceRegistry() ); + this.collectionPersisterClass = MappingHelper.classForName( + collection.getPersister(), getDefaults().getServiceRegistry() + ); this.cascade = MappingHelper.getStringValue( collection.getCascade(), mappingDefaults.getDefaultCascade() ); //Attribute typeNode = collectionElement.attribute( "collection-type" ); @@ -93,7 +95,7 @@ public class HbmPluralAttributeBindingState extends AbstractHbmAttributeBindingS public FetchMode getFetchMode() { FetchMode fetchMode; if ( collection.getFetch() != null ) { - fetchMode = "join".equals( collection.getFetch() ) ? FetchMode.JOIN : FetchMode.SELECT; + fetchMode = "join".equals( collection.getFetch().value() ) ? FetchMode.JOIN : FetchMode.SELECT; } else { String jfNodeValue = ( collection.getOuterJoin().value() == null ? "auto" : collection.getOuterJoin() @@ -117,7 +119,7 @@ public class HbmPluralAttributeBindingState extends AbstractHbmAttributeBindingS } public boolean isExtraLazy() { - return ( "extra".equals( collection.getLazy() ) ); + return ( "extra".equals( collection.getLazy().value() ) ); } public String getElementTypeName() { @@ -128,6 +130,7 @@ public class HbmPluralAttributeBindingState extends AbstractHbmAttributeBindingS public String getElementNodeName() { return collection.getElement().getNode(); } + public boolean isInverse() { return collection.isInverse(); } @@ -137,7 +140,7 @@ public class HbmPluralAttributeBindingState extends AbstractHbmAttributeBindingS } public boolean isSubselectLoadable() { - return "subselect".equals( collection.getFetch() ); + return "subselect".equals( collection.getFetch().value() ); } public String getCacheConcurrencyStrategy() {