HHH-18384 Changes after PR comments

This commit is contained in:
Čedomir Igaly 2024-11-21 12:29:28 +01:00 committed by Marco Belladelli
parent f5696f9f67
commit 5cc79fbd38
2 changed files with 6 additions and 4 deletions

View File

@ -633,7 +633,8 @@ public class EntityBinder {
inferredData.getPropertyType(), inferredData.getPropertyType(),
propertyAccessor propertyAccessor
); );
addElementsOfClass( baseClassElements, propContainer, context, 0 ); final int idPropertyCount = addElementsOfClass( baseClassElements, propContainer, context, 0 );
assert idPropertyCount == 1;
//Id properties are on top and there is only one //Id properties are on top and there is only one
return baseClassElements.get( 0 ); return baseClassElements.get( 0 );
} }

View File

@ -585,8 +585,8 @@ public class PropertyBinder {
* @param propertyContainer Metadata about a class and its properties * @param propertyContainer Metadata about a class and its properties
* @param idPropertyCounter number of id properties already present in list of {@link PropertyData} instances * @param idPropertyCounter number of id properties already present in list of {@link PropertyData} instances
* *
* @return total number of id properties found after iterating the elements of * @return total number of id properties found after iterating the elements of {@code annotatedClass}
* {@code annotatedClass} using the determined access strategy * using the determined access strategy (starting from the provided {@code idPropertyCounter})
*/ */
static int addElementsOfClass( static int addElementsOfClass(
List<PropertyData> elements, List<PropertyData> elements,
@ -602,7 +602,8 @@ public class PropertyBinder {
PropertyContainer propertyContainer, PropertyContainer propertyContainer,
MemberDetails property, MemberDetails property,
List<PropertyData> inFlightPropertyDataList, List<PropertyData> inFlightPropertyDataList,
MetadataBuildingContext context, int idPropertyCounter) { MetadataBuildingContext context,
int idPropertyCounter) {
// see if inFlightPropertyDataList already contains a PropertyData for this name, // see if inFlightPropertyDataList already contains a PropertyData for this name,
// and if so, skip it... // and if so, skip it...
for ( PropertyData propertyData : inFlightPropertyDataList ) { for ( PropertyData propertyData : inFlightPropertyDataList ) {