Skip to content

Commit 5cc79fb

Browse files
cigalymbellade
authored andcommitted
HHH-18384 Changes after PR comments
1 parent f5696f9 commit 5cc79fb

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,8 @@ private static PropertyData getUniqueIdPropertyFromBaseClass(
633633
inferredData.getPropertyType(),
634634
propertyAccessor
635635
);
636-
addElementsOfClass( baseClassElements, propContainer, context, 0 );
636+
final int idPropertyCount = addElementsOfClass( baseClassElements, propContainer, context, 0 );
637+
assert idPropertyCount == 1;
637638
//Id properties are on top and there is only one
638639
return baseClassElements.get( 0 );
639640
}

hibernate-core/src/main/java/org/hibernate/boot/model/internal/PropertyBinder.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,8 +585,8 @@ private void validateOptimisticLock(boolean excluded) {
585585
* @param propertyContainer Metadata about a class and its properties
586586
* @param idPropertyCounter number of id properties already present in list of {@link PropertyData} instances
587587
*
588-
* @return total number of id properties found after iterating the elements of
589-
* {@code annotatedClass} using the determined access strategy
588+
* @return total number of id properties found after iterating the elements of {@code annotatedClass}
589+
* using the determined access strategy (starting from the provided {@code idPropertyCounter})
590590
*/
591591
static int addElementsOfClass(
592592
List<PropertyData> elements,
@@ -602,7 +602,8 @@ private static int addProperty(
602602
PropertyContainer propertyContainer,
603603
MemberDetails property,
604604
List<PropertyData> inFlightPropertyDataList,
605-
MetadataBuildingContext context, int idPropertyCounter) {
605+
MetadataBuildingContext context,
606+
int idPropertyCounter) {
606607
// see if inFlightPropertyDataList already contains a PropertyData for this name,
607608
// and if so, skip it...
608609
for ( PropertyData propertyData : inFlightPropertyDataList ) {

0 commit comments

Comments
 (0)