mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-17081 Avoid error for same prop name in different inheritance types
This commit is contained in:
parent
b7bdb65164
commit
4dd35e59cf
@ -419,7 +419,7 @@ protected boolean shouldSkipResolveInstance(RowProcessingState rowProcessingStat
|
||||
.getEntityMetamodel()
|
||||
.isPolymorphic() ) {
|
||||
parentInitializer.resolveKey( rowProcessingState );
|
||||
return isReferencedModelPartInConcreteParent(
|
||||
return !isReferencedModelPartInConcreteParent(
|
||||
modelPart,
|
||||
currentNavigablePath,
|
||||
parentInitializer
|
||||
@ -437,7 +437,13 @@ private boolean isReferencedModelPartInConcreteParent(
|
||||
final EntityPersister parentConcreteDescriptor = parentInitializer.asEntityInitializer()
|
||||
.getConcreteDescriptor();
|
||||
if ( parentConcreteDescriptor != null && parentConcreteDescriptor.getEntityMetamodel().isPolymorphic() ) {
|
||||
final ModelPart concreteModelPart = parentConcreteDescriptor.findByPath( partNavigablePath.getLocalName() );
|
||||
final EntityMappingType entityType = modelPart.asAttributeMapping() != null ?
|
||||
modelPart.asAttributeMapping().getDeclaringType().findContainingEntityMapping() :
|
||||
modelPart.asEntityMappingType();
|
||||
final ModelPart concreteModelPart = parentConcreteDescriptor.findSubPart(
|
||||
partNavigablePath.getLocalName(),
|
||||
entityType
|
||||
);
|
||||
if ( concreteModelPart == null
|
||||
|| !modelPart.getJavaType().getJavaTypeClass()
|
||||
.isAssignableFrom( concreteModelPart.getJavaType().getJavaTypeClass() ) ) {
|
||||
@ -470,10 +476,10 @@ class AddressB extends Address{
|
||||
and for AddressB skip resolving the EntityJoinedFetchInitializer of UserA
|
||||
|
||||
*/
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
protected void resolveEntityInstance(
|
||||
|
Loading…
x
Reference in New Issue
Block a user