{"record":{"id":"ed3235d794cf2f85","repo":"hibernate/hibernate-orm","slug":"unable-to-determine-entity-for-fetch-profile-fetch","errorCode":null,"errorMessage":"Unable to determine entity for fetch profile fetch [%s:%s]","messagePattern":"Unable to determine entity for fetch profile fetch \\[(.+?):(.+?)\\]","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/FetchProfileBinder.java","lineNumber":55,"sourceCode":"\n\n\t/**\n\t * Handling for a {@code <fetch-profile/>} declaration.\n\t *\n\t * @param context Access to information relative to the mapping document containing this binding\n\t * @param fetchProfileBinding The {@code <fetch-profile/>} binding\n\t * @param containingEntityName The name of the entity containing the fetch profile declaration.  May\n\t * be {@code null} to indicate a fetch profile defined at the root.\n\t */\n\tpublic static void processFetchProfile(\n\t\t\tHbmLocalMetadataBuildingContext context,\n\t\t\tJaxbHbmFetchProfileType fetchProfileBinding,\n\t\t\tString containingEntityName) {\n\t\tfinal var profile = fetchProfile( context, fetchProfileBinding );\n\t\tfor ( var fetchBinding : fetchProfileBinding.getFetch() ) {\n\t\t\tfinal String entityName = entityName( containingEntityName, fetchBinding );\n\t\t\tif ( entityName == null ) {\n\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\t\"Unable to determine entity for fetch profile fetch [%s:%s]\",\n\t\t\t\t\t\t\t\tprofile.getName(),\n\t\t\t\t\t\t\t\tfetchBinding.getAssociation()\n\t\t\t\t\t\t),\n\t\t\t\t\t\tcontext.getOrigin()\n\t\t\t\t);\n\t\t\t}\n\t\t\tprofile.addFetch( new FetchProfile.Fetch(\n\t\t\t\t\tentityName,\n\t\t\t\t\tfetchBinding.getAssociation(),\n\t\t\t\t\tfetchMode( fetchBinding.getStyle().value() ),\n\t\t\t\t\tEAGER\n\t\t\t) );\n\t\t}\n\t}\n\n\tprivate static String entityName(String containingEntityName, JaxbHbmFetchProfileType.JaxbHbmFetch fetchBinding) {","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/FetchProfileBinder.java#L37-L73","documentation":"Error \"Unable to determine entity for fetch profile fetch [%s:%s]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An hbm.xml / orm.xml mapping document violates a mapping rule during bootstrap.","commonSituations":"Legacy XML mappings with invalid combinations (column+formula, mixed inheritance, missing identifiers, bad extends references).","solutions":["Correct the entity attribute of the <fetch-profile/> <fetch> element so it names a mapped entity, and the association attribute on it."],"exampleFix":"Correct the entity attribute of the <fetch-profile/> <fetch> element so it names a mapped entity, and the association attribute on it.","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"}