Skip to content

Commit 929f5ac

Browse files
cigalymbellade
authored andcommitted
HHH-18384 Changes after PR comments
1 parent cb6e7f8 commit 929f5ac

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
@@ -617,7 +617,8 @@ private static PropertyData getUniqueIdPropertyFromBaseClass(
617617
inferredData.getPropertyClass(),
618618
propertyAccessor
619619
);
620-
addElementsOfClass( baseClassElements, propContainer, context, 0 );
620+
final int idPropertyCount = addElementsOfClass( baseClassElements, propContainer, context, 0 );
621+
assert idPropertyCount == 1;
621622
//Id properties are on top and there is only one
622623
return baseClassElements.get( 0 );
623624
}

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
@@ -557,8 +557,8 @@ private void validateOptimisticLock(OptimisticLock optimisticLock) {
557557
* @param propertyContainer Metadata about a class and its properties
558558
* @param idPropertyCounter number of id properties already present in list of {@link PropertyData} instances
559559
*
560-
* @return total number of id properties found after iterating the elements of
561-
* {@code annotatedClass} using the determined access strategy
560+
* @return total number of id properties found after iterating the elements of {@code annotatedClass}
561+
* using the determined access strategy (starting from the provided {@code idPropertyCounter})
562562
*/
563563
static int addElementsOfClass(
564564
List<PropertyData> elements,
@@ -574,7 +574,8 @@ private static int addProperty(
574574
PropertyContainer propertyContainer,
575575
XProperty property,
576576
List<PropertyData> inFlightPropertyDataList,
577-
MetadataBuildingContext context, int idPropertyCounter) {
577+
MetadataBuildingContext context,
578+
int idPropertyCounter) {
578579
// see if inFlightPropertyDataList already contains a PropertyData for this name,
579580
// and if so, skip it..
580581
for ( PropertyData propertyData : inFlightPropertyDataList ) {

0 commit comments

Comments
 (0)