hibernate/hibernate-orm · error · IllegalArgumentException
Unrecognized cache-inclusions value : {}
Error message
Unrecognized cache-inclusions value : {} What it means
Error "Unrecognized cache-inclusions value : {}" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/transform/HbmXmlTransformer.java:1762
caching.setAccess( hbmClass.getCache().getUsage() );
caching.setIncludeLazy( convert( hbmClass.getCache().getInclude() ) );
entity.setCaching( caching );
}
private boolean convert(JaxbHbmCacheInclusionEnum hbmInclusion) {
if ( hbmInclusion == null ) {
return true;
}
if ( hbmInclusion == JaxbHbmCacheInclusionEnum.NON_LAZY ) {
return false;
}
if ( hbmInclusion == JaxbHbmCacheInclusionEnum.ALL ) {
return true;
}
throw new IllegalArgumentException( "Unrecognized cache-inclusions value : " + hbmInclusion );
}
private void transferResultSetMappings(String namePrefix, ResultSetMappingContainer container) {
final var resultSetMappings = container.getResultset();
resultSetMappings.forEach( (hbmMapping) -> {
final var mapping = transformResultSetMapping( namePrefix, hbmMapping );
mappingXmlBinding.getRoot().getSqlResultSetMappings().add( mapping );
} );
}
private void transferToolingHints(ToolingHintContainer container) {
if ( isNotEmpty( container.getToolingHints() ) ) {
handleUnsupported(
"Transformation of <meta/> (tooling hint) is not supported - `%s`",
hbmXmlBinding.getOrigin()
);
}
}View on GitHub (pinned to fad1729dce)
Solutions
- Set the cache include attribute to a recognized value: all or non-lazy.
- Fix typos in the cache-inclusions setting in the mapping document.
- Remove the attribute to use the default inclusion behavior.
When it happens
Trigger: The cache include attribute holds an unrecognized value.
Common situations: A legacy hbm.xml <cache include="..."> value other than all/non-lazy.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/8df8f2b87a03c3e3.
Report an issue: GitHub.