{"record":{"id":"0495ca07edf839e7","repo":"hibernate/hibernate-orm","slug":"unable-to-resolve-entity-reference-in-fetch-p","errorCode":null,"errorMessage":"Unable to resolve entity reference [{}] in fetch profile [{}]","messagePattern":"Unable to resolve entity reference \\[(.+?)\\] in fetch profile \\[(.+?)\\]","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java","lineNumber":128,"sourceCode":"\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 ) {\n\t\t\tfinal var persister = mappingMetamodel.getEntityDescriptor( entityName );\n\t\t\tif ( persister != null ) {\n\t\t\t\treturn persister;\n\t\t\t}\n\t\t}\n\t\tthrow new HibernateException( \"Unable to resolve entity reference [\" + mappingFetch.getEntity()\n\t\t\t\t+ \"] in fetch profile [\" + fetchProfile.getName() + \"]\" );\n\t}\n\n}\n","sourceCodeStart":110,"sourceCodeEnd":133,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/internal/FetchProfileHelper.java#L110-L133","documentation":"Error \"Unable to resolve entity reference [{}] in fetch profile [{}]\" 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":["Check the entity name in the fetch profile for typos and ensure the entity is mapped."],"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"}