{"record":{"id":"bc44ee03df45ce06","repo":"hibernate/hibernate-orm","slug":"collection-path-has-a-annotationsimplename","errorCode":null,"errorMessage":"Collection '<path>' has a '@<annotationSimpleName>' for an undefined filter named '<name>'","messagePattern":"Collection '<path>' has a '@<annotationSimpleName>' for an undefined filter named '<name>'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java","lineNumber":1883,"sourceCode":"\n\tprivate String getFilterConditionForJoinTable(FilterJoinTable filterJoinTableAnnotation) {\n\t\tfinal String condition = filterJoinTableAnnotation.condition();\n\t\treturn condition.isBlank()\n\t\t\t\t? getDefaultFilterCondition( filterJoinTableAnnotation.name(), filterJoinTableAnnotation )\n\t\t\t\t: condition;\n\t}\n\n\tprivate String getFilterCondition(Filter filter) {\n\t\tfinal String condition = filter.condition();\n\t\treturn condition.isBlank()\n\t\t\t\t? getDefaultFilterCondition( filter.name(), filter )\n\t\t\t\t: condition;\n\t}\n\n\tprivate String getDefaultFilterCondition(String name, Annotation annotation) {\n\t\tfinal var definition = getMetadataCollector().getFilterDefinition( name );\n\t\tif ( definition == null ) {\n\t\t\tthrow new AnnotationException( \"Collection '\" + qualify( propertyHolder.getPath(), propertyName )\n\t\t\t\t\t+ \"' has a '@\" + annotation.annotationType().getSimpleName()\n\t\t\t\t\t+ \"' for an undefined filter named '\" + name + \"'\" );\n\t\t}\n\t\tfinal String defaultCondition = definition.getDefaultFilterCondition();\n\t\tif ( isBlank( defaultCondition ) ) {\n\t\t\tthrow new AnnotationException( \"Collection '\" + qualify( propertyHolder.getPath(), propertyName ) +\n\t\t\t\t\t\"' has a '@\"  + annotation.annotationType().getSimpleName()\n\t\t\t\t\t+ \"' with no 'condition' and no default condition was given by the '@FilterDef' named '\"\n\t\t\t\t\t+ name + \"'\" );\n\t\t}\n\t\treturn defaultCondition;\n\t}\n\n\tprivate void setCache(Cache cache) {\n\t\tif ( cache != null ) {\n\t\t\tcacheRegionName = nullIfEmpty( cache.region() );\n\t\t\tcacheConcurrencyStrategy = EntityBinder.getCacheConcurrencyStrategy( cache.usage() );\n\t\t}","sourceCodeStart":1865,"sourceCodeEnd":1901,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java#L1865-L1901","documentation":"Error \"Collection '<path>' has a '@<annotationSimpleName>' for an undefined filter named '<name>'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A @Filter/@FilterJoinTable usage references an undefined filter or has no usable condition.","commonSituations":"@Filter used without a matching @FilterDef, a misspelled filter name, or neither the usage nor the FilterDef supplying a default condition.","solutions":["Define the filter with @FilterDef using the referenced name, or correct the filter name in the annotation."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}