HHH-15658 Embeddable with more fields than the parent fails with Index out of Bounds

This commit is contained in:
Andrea Boriero 2022-11-10 13:27:13 +01:00 committed by Andrea Boriero
parent 255cf3e301
commit 838cbb81ca
1 changed files with 6 additions and 9 deletions

View File

@ -2025,18 +2025,15 @@ public abstract class AbstractEntityPersister
} }
private boolean isSelectable(FetchParent fetchParent, Fetchable fetchable) { private boolean isSelectable(FetchParent fetchParent, Fetchable fetchable) {
if ( fetchable instanceof AttributeMapping ) { if ( fetchParent instanceof EmbeddableResultGraphNode ) {
if ( fetchParent instanceof EmbeddableResultGraphNode
&& ( (EmbeddableResultGraphNode) fetchParent).getReferencedMappingContainer() == getIdentifierMapping() ) {
return true; return true;
} }
else { else if ( fetchable instanceof AttributeMapping ) {
final int propertyNumber = ( (AttributeMapping) fetchable ).getStateArrayPosition(); final int propertyNumber = ( (AttributeMapping) fetchable ).getStateArrayPosition();
// final int tableNumber = getSubclassPropertyTableNumber( propertyNumber ); // final int tableNumber = getSubclassPropertyTableNumber( propertyNumber );
// return !isSubclassTableSequentialSelect( tableNumber ) && propertySelectable[propertyNumber]; // return !isSubclassTableSequentialSelect( tableNumber ) && propertySelectable[propertyNumber];
return propertySelectable[propertyNumber]; return propertySelectable[propertyNumber];
} }
}
else { else {
return true; return true;
} }