{"record":{"id":"fe7876705d077ed0","repo":"hibernate/hibernate-orm","slug":"could-not-determine-target-type-for-dynamic-attrib-fe7876","errorCode":null,"errorMessage":"Could not determine target type for dynamic attribute [%s#%s]","messagePattern":"Could not determine target type for dynamic attribute \\[(.+?)#(.+?)\\]","errorType":"exception","errorClass":"UnknownAttributeTypeException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/DynamicModelHelper.java","lineNumber":599,"sourceCode":"\t\tif ( jaxbBasicMapping instanceof JaxbBasicImpl jaxbBasicAttribute ) {\n\t\t\tfinal var temporalType = jaxbBasicAttribute.getTemporal();\n\t\t\tif ( temporalType != null ) {\n\t\t\t\treturn resolveTemporalJavaType( temporalType, xmlDocumentContext );\n\t\t\t}\n\t\t}\n\n\t\tfinal String declaringTypeName;\n\t\tif ( declaringType instanceof JaxbEntity jaxbEntity ) {\n\t\t\tdeclaringTypeName = nullIfEmpty( jaxbEntity.getName() );\n\t\t}\n\t\telse if ( declaringType instanceof JaxbEmbeddable jaxbEmbeddable ) {\n\t\t\tdeclaringTypeName = nullIfEmpty( jaxbEmbeddable.getName() );\n\t\t}\n\t\telse {\n\t\t\tdeclaringTypeName = null;\n\t\t}\n\n\t\tthrow new UnknownAttributeTypeException(\n\t\t\t\tString.format(\n\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\"Could not determine target type for dynamic attribute [%s#%s]\",\n\t\t\t\t\t\tdeclaringTypeName != null ? declaringTypeName : declaringType.getClazz(),\n\t\t\t\t\t\tjaxbBasicMapping.getName()\n\t\t\t\t)\n\t\t);\n\t}\n\n\t/**\n\t * Conceptually very similar to {@linkplain SimpleTypeInterpretation}, but here the distinction between\n\t * primitive and wrapper ({@code boolean} and {@code Boolean} e.g.) is important while in\n\t * SimpleTypeInterpretation we only care about the wrapper.\n\t */\n\tprivate static ClassDetails resolveBasicMappingTarget(SimpleTypeInterpretation targetInterpretation, XmlDocumentContext xmlDocumentContext) {\n\t\tfinal var modelsContext = xmlDocumentContext.getBootstrapContext().getModelsContext();\n\t\tfinal var classDetailsRegistry = modelsContext.getClassDetailsRegistry();\n\t\treturn classDetailsRegistry.resolveClassDetails( targetInterpretation.getJavaType().getName() );","sourceCodeStart":581,"sourceCodeEnd":617,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/DynamicModelHelper.java#L581-L617","documentation":"Error \"Could not determine target type for dynamic attribute [%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":["Specify the attribute target type explicitly in the XML mapping (target/target-class/class attribute) since it cannot be inferred for a dynamic (Map) model."],"exampleFix":"Specify the attribute target type explicitly in the XML mapping (target/target-class/class attribute) since it cannot be inferred for a dynamic (Map) model.","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"}