Skip to content

Commit cc60feb

Browse files
committed
HHH-19706 If property is identifier property, treat it as simple property
1 parent ff89f51 commit cc60feb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-core/src/main/java/org/hibernate/metamodel/internal/AttributeFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,8 @@ private static Member resolveVirtualIdentifierMember( Property property, EntityP
727727

728728
private static Member resolveEntityMember(Property property, EntityPersister declaringEntity) {
729729
final String propertyName = property.getName();
730-
final AttributeMapping attributeMapping = declaringEntity.findAttributeMapping( propertyName );
731-
return attributeMapping == null
730+
return !propertyName.equals( declaringEntity.getIdentifierPropertyName() )
731+
&& declaringEntity.findAttributeMapping( propertyName ) == null
732732
// just like in #determineIdentifierJavaMember , this *should* indicate we have an IdClass mapping
733733
? resolveVirtualIdentifierMember( property, declaringEntity )
734734
: getter( declaringEntity, property, propertyName, property.getType().getReturnedClass() );

0 commit comments

Comments
 (0)