{"record":{"id":"a7bf5c8ac0ac742f","repo":"hibernate/hibernate-orm","slug":"entity-name-has-a-filter-for-an-undefined","errorCode":null,"errorMessage":"Entity '${name}' has a '@Filter' for an undefined filter named '${filterName}'","messagePattern":"Entity '(.+?)' has a '@Filter' for an undefined filter named '(.+?)'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java","lineNumber":1626,"sourceCode":"\t\t\tfinal String filterName = filter.name();\n\t\t\tString condition = filter.condition();\n\t\t\tif ( condition.isBlank() ) {\n\t\t\t\tcondition = getDefaultFilterCondition( filterName );\n\t\t\t}\n\t\t\tpersistentClass.addFilter(\n\t\t\t\t\tfilterName,\n\t\t\t\t\tcondition,\n\t\t\t\t\tfilter.deduceAliasInjectionPoints(),\n\t\t\t\t\ttoAliasTableMap( filter.aliases() ),\n\t\t\t\t\ttoAliasEntityMap( filter.aliases() )\n\t\t\t);\n\t\t}\n\t}\n\n\tprivate String getDefaultFilterCondition(String filterName) {\n\t\tfinal var definition = getMetadataCollector().getFilterDefinition( filterName );\n\t\tif ( definition == null ) {\n\t\t\tthrow new AnnotationException( \"Entity '\" + name\n\t\t\t\t\t+ \"' has a '@Filter' for an undefined filter named '\" + filterName + \"'\" );\n\t\t}\n\t\tfinal String condition = definition.getDefaultFilterCondition();\n\t\tif ( isBlank( condition ) ) {\n\t\t\tthrow new AnnotationException( \"Entity '\" + name +\n\t\t\t\t\t\"' has a '@Filter' with no 'condition' and no default condition was given by the '@FilterDef' named '\"\n\t\t\t\t\t+ filterName + \"'\" );\n\t\t}\n\t\treturn condition;\n\t}\n\n\tprivate void bindSynchronize() {\n\t\tfinal var synchronize = annotatedClass.getAnnotationUsage( Synchronize.class, modelsContext() );\n\t\tif ( synchronize != null ) {\n\t\t\tfinal boolean logical = synchronize.logical();\n\t\t\tfor ( String tableName : synchronize.value() ) {\n\t\t\t\tfinal String physicalName = logical ? toPhysicalName( tableName ) : tableName;\n\t\t\t\tpersistentClass.addSynchronizedTable( physicalName );","sourceCodeStart":1608,"sourceCodeEnd":1644,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java#L1608-L1644","documentation":"Error \"Entity '${name}' has a '@Filter' for an undefined filter named '${filterName}'\" 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 under the referenced name, or fix the filter name in @Filter."],"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"}