From b520a4a11ecfda1e0364911aa26eb52df1eb446f Mon Sep 17 00:00:00 2001 From: Emmanuel Bernard Date: Thu, 14 Jan 2010 10:18:00 +0000 Subject: [PATCH] HHH-4796 fix NPE when an @AssociationOverride joinColumn is set but no @AssociationOverride joinTable is on a given property Fix minor issues git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18554 1b8cb986-b30d-0410-93ca-fae66ebed9b2 --- .../main/java/org/hibernate/cfg/AbstractPropertyHolder.java | 6 +++--- .../java/org/hibernate/cfg/AnnotationConfiguration.java | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java b/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java index a73347c982..82ae2067a2 100644 --- a/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java +++ b/annotations/src/main/java/org/hibernate/cfg/AbstractPropertyHolder.java @@ -199,7 +199,7 @@ public abstract class AbstractPropertyHolder implements PropertyHolder { private JoinColumn[] getExactOverriddenJoinColumn(String propertyName) { JoinColumn[] override = null; if ( parent != null ) { - override = parent.getOverriddenJoinColumn( propertyName ); + override = parent.getExactOverriddenJoinColumn( propertyName ); } if ( override == null && currentPropertyJoinColumnOverride != null ) { override = currentPropertyJoinColumnOverride.get( propertyName ); @@ -249,9 +249,9 @@ public abstract class AbstractPropertyHolder implements PropertyHolder { private JoinTable getExactOverriddenJoinTable(String propertyName) { JoinTable override = null; if ( parent != null ) { - override = parent.getOverriddenJoinTable( propertyName ); + override = parent.getExactOverriddenJoinTable( propertyName ); } - if ( override == null && currentPropertyJoinColumnOverride != null ) { + if ( override == null && currentPropertyJoinTableOverride != null ) { override = currentPropertyJoinTableOverride.get( propertyName ); } if ( override == null && holderJoinTableOverride != null ) { diff --git a/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java b/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java index b585cd5fc8..4fb6e21c67 100644 --- a/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java +++ b/annotations/src/main/java/org/hibernate/cfg/AnnotationConfiguration.java @@ -1,4 +1,4 @@ -// $Id:$ +// $Id$ /* * Hibernate, Relational Persistence for Idiomatic Java * @@ -893,7 +893,7 @@ public class AnnotationConfiguration extends Configuration { } catch ( DocumentException e ) { //oops asXML fails even if the core doc parses initially - new AssertionFailure("Error in DOM4J leads to a bug in Hibernate", e); + throw new AssertionFailure("Error in DOM4J leads to a bug in Hibernate", e); } }