{"record":{"id":"e7889ae7c36b089e","repo":"hibernate/hibernate-orm","slug":"fetch-profile-s-specified-an-association-that-i","errorCode":null,"errorMessage":"Fetch profile [%s] specified an association that is not an association - %s","messagePattern":"Fetch profile \\[(.+?)\\] specified an association that is not an association - (.+?)","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java","lineNumber":104,"sourceCode":"\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;\n\t}\n\n\tprivate static EntityPersister getEntityPersister(\n\t\t\tMappingMetamodel mappingMetamodel,\n\t\t\tFetchProfile fetchProfile,\n\t\t\torg.hibernate.mapping.FetchProfile.Fetch mappingFetch) {\n\t\tfinal String entityName = mappingMetamodel.getImportedName( mappingFetch.getEntity() );\n\t\tif ( entityName != null ) {","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java#L86-L122","documentation":"Error \"Fetch profile [%s] specified an association that is not an association - %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":["Point the fetch profile at a real association (to-one/to-many), not a basic attribute."],"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"}