Skip to content

Commit a90aaa4

Browse files
gbadneryrodiere
andcommitted
HHH-14467 Avoid false positives when detecting *ToOne associations that are part of the identifier
Co-authored-by: Yoann Rodière <[email protected]>
1 parent 021b274 commit a90aaa4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/ToOneFkSecondPass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ else if ( property != null) {
7979
Iterator it = ( (Component) valueIdentifier ).getPropertyIterator();
8080
while ( it.hasNext() ) {
8181
Property idProperty = (Property) it.next();
82-
if ( localPath.startsWith( idProperty.getName() ) ) {
82+
if ( localPath.equals( idProperty.getName() ) || localPath.startsWith( idProperty.getName() + "." ) ) {
8383
return true;
8484
}
8585
}

0 commit comments

Comments
 (0)