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,13 +682,10 @@ public class BinderHelper {
}
if ( propertyHolder.isInIdClass() ) {
PropertyData pd = mappings.getPropertyAnnotatedWithIdAndToOne( persistentXClass, propertyName );
if ( pd == null ) {
String propertyPath = isId ? "" : propertyName;
return mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyPath );
}
else {
return pd;
if ( pd == null && System.getProperty( "hibernate.enable_specj_proprietary_syntax" ) != null ) {
pd = mappings.getPropertyAnnotatedWithMapsId( persistentXClass, propertyName );
}
return pd;
}
else {
String propertyPath = isId ? "" : propertyName;