{"record":{"id":"fe9741b3c04713ce","repo":"hibernate/hibernate-orm","slug":"could-not-determine-how-to-apply-convert-attribut","errorCode":null,"errorMessage":"Could not determine how to apply @Convert(attributeName='%s') to collection [%s]","messagePattern":"Could not determine how to apply @Convert\\(attributeName='(.+?)'\\) to collection \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionPropertyHolder.java","lineNumber":163,"sourceCode":"\t\t\t}\n\t\t\telse if ( canKeyBeConverted ) {\n\t\t\t\tkeyPath = removePrefix( attributeName, \"key\", attributeName );\n\t\t\t\telementPath = null;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tkeyPath = null;\n\t\t\t\telementPath = removePrefix( attributeName, \"value\", attributeName );\n\t\t\t}\n\n\t\t\tif ( keyPath != null ) {\n\t\t\t\tkeyAttributeConversionInfoMap.put( keyPath, info );\n\t\t\t}\n\t\t\telse if ( elementPath != null ) {\n\t\t\t\telementAttributeConversionInfoMap.put( elementPath, info );\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// specified attributeName needs to have 'key.' or 'value.' prefix\n\t\t\t\tthrow new IllegalStateException(\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 how to apply @Convert(attributeName='%s') to collection [%s]\",\n\t\t\t\t\t\t\t\tattributeName,\n\t\t\t\t\t\t\t\tcollection.getRole()\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate void throwMissingAttributeName() {\n\t\tthrow new IllegalStateException( \"'@Convert' annotation for map [\" + collection.getRole()\n\t\t\t\t\t\t\t\t\t+ \"] must specify 'attributeName=\\\"key\\\"' or 'attributeName=\\\"value\\\"'\" );\n\t}\n\n\tprivate static void logSpecNoncompliance(String attributeName, String role) {\n\t\tfinal boolean specCompliant = isNotEmpty( attributeName )","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/CollectionPropertyHolder.java#L145-L181","documentation":"Error \"Could not determine how to apply @Convert(attributeName='%s') to collection [%s]\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A @Convert / AttributeConverter declaration is missing required information or applies to a target that forbids conversion.","commonSituations":"@Convert without attributeName on a class-level or embedded target, or a converter clashing with a mapping annotation like @Enumerated/@Temporal that requires disableConversion=true.","solutions":["Correct the attributeName in @Convert to match an element, key, or value path valid for the collection.","Or move the @Convert annotation to the owning attribute it applies to."],"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"}