{"record":{"id":"69124d587aaf661f","repo":"hibernate/hibernate-orm","slug":"entity-name-has-a-filter-with-no-conditio","errorCode":null,"errorMessage":"Entity '${name}' has a '@Filter' with no 'condition' and no default condition was given by the '@FilterDef' named '${filterName}'","messagePattern":"Entity '(.+?)' has a '@Filter' with no 'condition' and no default condition was given by the '@FilterDef' named '(.+?)'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java","lineNumber":1631,"sourceCode":"\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 );\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate String toPhysicalName(String logicalName) {","sourceCodeStart":1613,"sourceCodeEnd":1649,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/EntityBinder.java#L1613-L1649","documentation":"Error \"Entity '${name}' has a '@Filter' with no 'condition' and no default condition was given by the '@FilterDef' 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":["Add a condition to the @Filter, or set a defaultCondition on the referenced @FilterDef."],"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"}