hibernate/hibernate-orm · error · EntityNotFoundException
No entity of type '%s' existed for the ids %s
Error message
No entity of type '%s' existed for the ids %s
What it means
Error "No entity of type '%s' existed for the ids %s" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/internal/find/Helper.java:154
throw new EntityNotFoundException(
"No entity of type '%s' existed for one or more of the given ids"
.formatted( entityName )
);
}
}
}
else {
List<Object> missingKeys = null;
for ( int i = 0; i < results.size(); i++ ) {
if ( results.get( i ) == null ) {
if ( missingKeys == null ) {
missingKeys = new ArrayList<>();
}
missingKeys.add( keys.get( i ) );
}
}
if ( missingKeys != null ) {
throw new EntityNotFoundException(
"No entity of type '%s' existed for the ids %s"
.formatted( entityName, missingKeys )
);
}
}
}
private static FindMultipleOption.OrderingMode determineOrderingMode(FindOption[] findOptions) {
if ( findOptions != null ) {
for ( var findOption : findOptions ) {
if ( findOption instanceof FindMultipleOption.OrderingMode requestedMode ) {
return requestedMode;
}
}
}
return FindMultipleOption.OrderingMode.ORDERED;
}
}View on GitHub (pinned to fad1729dce)
Solutions
- Check that every id in the list corresponds to an existing row; remove or insert missing ids before the load.
When it happens
Trigger: Thrown at hibernate-core/src/main/java/org/hibernate/internal/find/Helper.java:154 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/5ab2dcbc314a64f8.
Report an issue: GitHub.