{"record":{"id":"ed747b2f42f92518","repo":"hibernate/hibernate-orm","slug":"attributeconverter-not-allowed-for-attribute","errorCode":null,"errorMessage":"'AttributeConverter' not allowed for attribute '{}' annotated '@{}' (use '@Convert(disableConversion=true)' to suppress this error)","messagePattern":"'AttributeConverter' not allowed for attribute '(.+?)' annotated '@(.+?)' \\(use '@Convert\\(disableConversion=true\\)' to suppress this error\\)","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java","lineNumber":1123,"sourceCode":"\t\t\tdisallowConverter( attribute, ManyToOne.class, autoApply );\n\t\t\tdisallowConverter( attribute, OneToOne.class, autoApply );\n\t\t\tdisallowConverter( attribute, OneToMany.class, autoApply );\n\t\t\tdisallowConverter( attribute, ManyToMany.class, autoApply );\n\t\t\t// Note that @Convert is only allowed in conjunction with\n\t\t\t// @Embedded if it specifies a field using attributeName\n\t\t\tdisallowConverter( attribute, Embedded.class, autoApply );\n\t\t\tdisallowConverter( attribute, EmbeddedId.class, autoApply );\n\t\t}\n\t\t// I assume that these do not work with converters (no tests)\n\t\tdisallowConverter( attribute, Struct.class, autoApply );\n\t\tdisallowConverter( attribute, Array.class, autoApply );\n\t\tdisallowConverter( attribute, Any.class, autoApply );\n\t\tconverterDescriptor = attributeConverterDescriptor;\n\t}\n\n\tvoid disallowConverter(MemberDetails attribute, Class<? extends Annotation> annotationType, boolean autoApply) {\n\t\tif ( attribute.hasDirectAnnotationUsage( annotationType ) ) {\n\t\t\tthrow new AnnotationException( \"'AttributeConverter' not allowed for attribute '\" + attribute.getName()\n\t\t\t\t\t\t\t\t\t\t\t+ \"' annotated '@\" + annotationType.getName() + \"'\"\n\t\t\t\t\t\t\t\t\t\t\t+ ( autoApply ? \" (use '@Convert(disableConversion=true)' to suppress this error)\" : \"\" ) );\n\t\t}\n\t}\n\n\tpublic BasicValue make() {\n\t\tif ( basicValue != null ) {\n\t\t\treturn basicValue;\n\t\t}\n\n\t\tcolumns.checkPropertyConsistency();\n\n\t\tif ( table == null ) {\n\t\t\ttable = columns.getTable();\n\t\t}\n\n\t\tbasicValue = new BasicValue( buildingContext, table );\n","sourceCodeStart":1105,"sourceCodeEnd":1141,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BasicValueBinder.java#L1105-L1141","documentation":"Error \"'AttributeConverter' not allowed for attribute '{}' annotated '@{}' (use '@Convert(disableConversion=true)' to suppress this error)\" 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":["Remove the AttributeConverter for the attribute, since the other annotation forbids conversion.","Or add @Convert(disableConversion=true) to explicitly suppress conversion for the attribute."],"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"}