{"record":{"id":"8b3a2314d612be55","repo":"hibernate/hibernate-orm","slug":"collection-path-is-an-association-with-no-join","errorCode":null,"errorMessage":"Collection '<path>' is an association with no join table and may not have a 'WhereJoinTable'","messagePattern":"Collection '<path>' is an association with no join table and may not have a 'WhereJoinTable'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java","lineNumber":1809,"sourceCode":"\t\t\tcollection.setManyToManyWhere( whereClause );\n\t\t}\n\t\telse {\n\t\t\t// A one-to-many association does not have an association (join) table.\n\t\t\t// Collection#setWhere is used to set the \"where\" clause that applies to the collection table\n\t\t\t// (which is the associated entity table for a one-to-many association).\n\t\t\tcollection.setWhere( whereClause );\n\t\t}\n\n\t\tfinal String whereJoinTableClause = getWhereJoinTableClause();\n\t\tif ( isNotBlank( whereJoinTableClause ) ) {\n\t\t\tif ( hasAssociationTable ) {\n\t\t\t\t// This is a many-to-many association.\n\t\t\t\t// Collection#setWhere is used to set the \"where\" clause that applies to the collection table\n\t\t\t\t// (which is the join table for a many-to-many association).\n\t\t\t\tcollection.setWhere( whereJoinTableClause );\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new AnnotationException(\n\t\t\t\t\t\t\"Collection '\" + qualify( propertyHolder.getPath(), propertyName )\n\t\t\t\t\t\t\t\t+ \"' is an association with no join table and may not have a 'WhereJoinTable'\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate String getWhereJoinTableClause() {\n\t\tfinal var joinTableRestriction = property.getDirectAnnotationUsage( SQLJoinTableRestriction.class );\n\t\treturn joinTableRestriction != null ? joinTableRestriction.value() : null;\n\t}\n\n\tprivate String getWhereClause() {\n\t\t// There are 2 possible sources of \"where\" clauses that apply to the associated entity table:\n\t\t// 1) from the associated entity mapping; i.e., @Entity @Where(clause=\"...\")\n\t\t//    (ignored if useEntityWhereClauseForCollections == false)\n\t\t// 2) from the collection mapping;\n\t\t//    for one-to-many, e.g., @OneToMany @JoinColumn @Where(clause=\"...\") public Set<Rating> getRatings();","sourceCodeStart":1791,"sourceCodeEnd":1827,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionBinder.java#L1791-L1827","documentation":"Error \"Collection '<path>' is an association with no join table and may not have a 'WhereJoinTable'\" 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":["Remove the @WhereJoinTable from the association, since it has no join table.","Or configure a join table for the association if the where-join-table clause is needed."],"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"}