hibernate/hibernate-orm · error · AnnotationException
Collection '<path>' is an association with no join table and
Error message
Collection '<path>' is an association with no join table and may not have a '@FilterJoinTable'
What it means
Error "Collection '<path>' is an association with no join table and may not have a '@FilterJoinTable'" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java:1861
);
return restrictionOnClass != null ? restrictionOnClass.value() : null;
}
private void addFilterJoinTable(boolean hasAssociationTable, FilterJoinTable filter) {
if ( hasAssociationTable ) {
final Map<String,String> aliasTableMap = new HashMap<>();
final Map<String,String> aliasEntityMap = new HashMap<>();
fillAliasMaps( filter.aliases(), aliasTableMap, aliasEntityMap );
collection.addFilter(
filter.name(),
getFilterConditionForJoinTable( filter ),
filter.deduceAliasInjectionPoints(),
aliasTableMap,
aliasEntityMap
);
}
else {
throw new AnnotationException( "Collection '" + qualify( propertyHolder.getPath(), propertyName )
+ "' is an association with no join table and may not have a '@FilterJoinTable'" );
}
}
private String getFilterConditionForJoinTable(FilterJoinTable filterJoinTableAnnotation) {
final String condition = filterJoinTableAnnotation.condition();
return condition.isBlank()
? getDefaultFilterCondition( filterJoinTableAnnotation.name(), filterJoinTableAnnotation )
: condition;
}
private String getFilterCondition(Filter filter) {
final String condition = filter.condition();
return condition.isBlank()
? getDefaultFilterCondition( filter.name(), filter )
: condition;
}
View on GitHub (pinned to fad1729dce)
Solutions
- Remove @FilterJoinTable from the association, since it has no join table.
- Or configure a join table for the association if join-table filtering is needed.
When it happens
Trigger: A @Filter/@FilterJoinTable usage references an undefined filter or has no usable condition.
Common situations: @Filter used without a matching @FilterDef, a misspelled filter name, or neither the usage nor the FilterDef supplying a default condition.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/1229434847150c35.
Report an issue: GitHub.