{"record":{"id":"ea436a9e0b82dcda","repo":"hibernate/hibernate-orm","slug":"could-not-determine-target-type-for-dynamic-attrib","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":438,"sourceCode":"\t\t\tcase LIST -> {\n\t\t\t\tcollectionClassDetails = listType( classDetailsRegistry );\n\t\t\t\ttypeParams = List.of( elementType );\n\t\t\t}\n\t\t\tcase SET -> {\n\t\t\t\tcollectionClassDetails = setType( jaxbPluralAttribute, classDetailsRegistry );\n\t\t\t\ttypeParams = List.of( elementType );\n\t\t\t}\n\t\t\tcase MAP -> {\n\t\t\t\tcollectionClassDetails = mapType( jaxbPluralAttribute, classDetailsRegistry );\n\t\t\t\t// for now, just use wildcard for the key\n\t\t\t\tfinal ClassDetails objectClassDetails = classDetailsRegistry.resolveClassDetails( OBJECT_CLASS_NAME );\n\t\t\t\ttypeParams = List.of(\n\t\t\t\t\t\tnew WildcardTypeDetailsImpl( new ClassTypeDetailsImpl( objectClassDetails, TypeDetails.Kind.CLASS ), true ),\n\t\t\t\t\t\telementType\n\t\t\t\t);\n\t\t\t}\n\t\t\tdefault -> {\n\t\t\t\tthrow new UnknownAttributeTypeException(\n\t\t\t\t\t\tString.format(\n\t\t\t\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\t\t\t\"Could not determine target type for dynamic attribute [%s, %s]\",\n\t\t\t\t\t\t\t\tdeclaringType,\n\t\t\t\t\t\t\t\tjaxbPluralAttribute.getName()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn new ParameterizedTypeDetailsImpl( collectionClassDetails, typeParams, declaringType );\n\t}\n\n\tprivate static ClassDetails collectionType(MutableClassDetailsRegistry classDetailsRegistry) {\n\t\tif ( COLLECTION_CLASS_DETAILS == null ) {\n\t\t\tCOLLECTION_CLASS_DETAILS = classDetailsRegistry.getClassDetails( Collection.class.getName() );\n\t\t}\n\t\treturn COLLECTION_CLASS_DETAILS;","sourceCodeStart":420,"sourceCodeEnd":456,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/models/xml/internal/DynamicModelHelper.java#L420-L456","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"}