HHH-14467 Avoid false positives when detecting *ToOne associations that are part of the identifier

Co-authored-by: Yoann Rodière <yoann@hibernate.org>
This commit is contained in:
gbadner 2021-02-25 08:55:45 -08:00 committed by Yoann Rodière
parent 021b2741ab
commit a90aaa48b4
1 changed files with 1 additions and 1 deletions

View File

@ -79,7 +79,7 @@ public class ToOneFkSecondPass extends FkSecondPass {
Iterator it = ( (Component) valueIdentifier ).getPropertyIterator();
while ( it.hasNext() ) {
Property idProperty = (Property) it.next();
if ( localPath.startsWith( idProperty.getName() ) ) {
if ( localPath.equals( idProperty.getName() ) || localPath.startsWith( idProperty.getName() + "." ) ) {
return true;
}
}