HHH-17119 Avoid type pollution when casting ModelPart to EntityMappingType
This commit is contained in:
parent
a6d1bea5b9
commit
062b8bcd68
|
@ -104,6 +104,11 @@ public interface EntityMappingType
|
|||
return getMappedJavaType();
|
||||
}
|
||||
|
||||
@Override
|
||||
default EntityMappingType asEntityMappingType() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
default MappingType getPartMappingType() {
|
||||
return this;
|
||||
|
|
|
@ -142,6 +142,10 @@ public interface ModelPart extends MappingModelExpressible {
|
|||
return null;
|
||||
}
|
||||
|
||||
default EntityMappingType asEntityMappingType(){
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* A short hand form of {@link #breakDownJdbcValues(Object, int, Object, Object, JdbcValueBiConsumer, SharedSessionContractImplementor)},
|
||||
* that passes 0 as offset and null for the two values {@code X} and {@code Y}.
|
||||
|
|
|
@ -172,7 +172,8 @@ public abstract class AbstractEntityInitializer extends AbstractFetchParentAcces
|
|||
: fetch.createAssembler( this, creationState );
|
||||
|
||||
final int stateArrayPosition = attributeMapping.getStateArrayPosition();
|
||||
final EntityMappingType declaringType = (EntityMappingType) attributeMapping.getDeclaringType();
|
||||
final EntityMappingType declaringType = attributeMapping.getDeclaringType().asEntityMappingType();
|
||||
|
||||
assemblers[declaringType.getSubclassId()][stateArrayPosition] = stateAssembler;
|
||||
for ( EntityMappingType subMappingType : declaringType.getSubMappingTypes() ) {
|
||||
assemblers[subMappingType.getSubclassId()][stateArrayPosition] = stateAssembler;
|
||||
|
|
Loading…
Reference in New Issue