{"record":{"id":"3e1f5a35409e10d7","repo":"hibernate/hibernate-orm","slug":"fetch-profile-s-specified-an-association-that-d","errorCode":null,"errorMessage":"Fetch profile [%s] specified an association that does not exist - %s","messagePattern":"Fetch profile \\[(.+?)\\] specified an association that does not exist - (.+?)","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java","lineNumber":96,"sourceCode":"\t\t\t}\n\n\t\t\t// then register the association with the FetchProfile\n\t\t\tfetchProfile.addFetch( new Fetch( association, fetchStyle, fetchTiming ) );\n\t\t}\n\t\treturn fetchProfile;\n\t}\n\n\tprivate static FetchStyle fetchStyle(FetchMode fetchMode) {\n\t\treturn switch ( fetchMode ) {\n\t\t\tcase JOIN -> FetchStyle.JOIN;\n\t\t\tcase SELECT -> FetchStyle.SELECT;\n\t\t\tcase SUBSELECT -> FetchStyle.SUBSELECT;\n\t\t};\n\t}\n\n\tprivate static void validateFetchablePart(ModelPart fetchablePart, String profileName, Association association) {\n\t\tif ( fetchablePart == null ) {\n\t\t\tthrow new HibernateException( String.format(\n\t\t\t\t\t\"Fetch profile [%s] specified an association that does not exist - %s\",\n\t\t\t\t\tprofileName,\n\t\t\t\t\tassociation.getRole()\n\t\t\t) );\n\t\t}\n\n\t\tif ( !isAssociation( fetchablePart ) ) {\n\t\t\tthrow new HibernateException( String.format(\n\t\t\t\t\t\"Fetch profile [%s] specified an association that is not an association - %s\",\n\t\t\t\t\tprofileName,\n\t\t\t\t\tassociation.getRole()\n\t\t\t) );\n\t\t}\n\t}\n\n\tprivate static boolean isAssociation(ModelPart fetchablePart) {\n\t\treturn fetchablePart instanceof EntityValuedModelPart\n\t\t\t|| fetchablePart instanceof PluralAttributeMapping;","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java#L78-L114","documentation":"Error \"Fetch profile [%s] specified an association that does not exist - %s\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a @FetchProfile declares a fetch that cannot be resolved against the entity mapping.","commonSituations":"Typical situations: the fetch profile names a property that does not exist or is not an association; the entity reference in the profile is misspelled or unmapped.","solutions":["Correct the association path in the @FetchProfile fetch override so it refers to an existing association."],"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"}