HHH-5578 implement a cleaner version of getPropertyOverriddenByMapperOrMapsId in the SpecJ case

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@20768 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Emmanuel Bernard 2010-10-04 09:45:41 +00:00
parent 3b3c8bc923
commit c21ea5e3e1
1 changed files with 3 additions and 6 deletions

View File

@ -682,14 +682,11 @@ public class BinderHelper {
} }
if ( propertyHolder.isInIdClass() ) { if ( propertyHolder.isInIdClass() ) {
PropertyData pd = mappings.getPropertyAnnotatedWithIdAndToOne( persistentXClass, propertyName ); PropertyData pd = mappings.getPropertyAnnotatedWithIdAndToOne( persistentXClass, propertyName );
if ( pd == null ) { if ( pd == null && System.getProperty( "hibernate.enable_specj_proprietary_syntax" ) != null ) {
String propertyPath = isId ? "" : propertyName; pd = mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyName );
return mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyPath );
} }
else {
return pd; return pd;
} }
}
else { else {
String propertyPath = isId ? "" : propertyName; String propertyPath = isId ? "" : propertyName;
return mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyPath ); return mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyPath );