{"record":{"id":"952fd00819c79c99","repo":"hibernate/hibernate-orm","slug":"identifier-attribute-s-is-annotated-s-which","errorCode":null,"errorMessage":"Identifier attribute '%s' is annotated '%s' which is not an '@IdGeneratorType'","messagePattern":"Identifier attribute '(.+?)' is annotated '(.+?)' which is not an '@IdGeneratorType'","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java","lineNumber":862,"sourceCode":"\t\tif ( idGeneratorAnnotations.size() + generatorAnnotations.size() > 1 ) {\n\t\t\tthrow new AnnotationException( String.format(\n\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\"Identifier attribute '%s' has too many generator annotations: %s\",\n\t\t\t\t\tgetPath( propertyHolder, inferredData ),\n\t\t\t\t\tcombineUntyped( idGeneratorAnnotations, generatorAnnotations )\n\t\t\t) );\n\t\t}\n\t\tif ( !idGeneratorAnnotations.isEmpty() ) {\n\t\t\tidValue.setCustomIdGeneratorCreator( identifierGeneratorCreator(\n\t\t\t\t\tidMemberDetails,\n\t\t\t\t\tidGeneratorAnnotations.get(0),\n\t\t\t\t\tidValue,\n\t\t\t\t\tbeanContainer( buildingContext )\n\t\t\t) );\n\t\t}\n\t\telse if ( !generatorAnnotations.isEmpty() ) {\n//\t\t\tidValue.setCustomGeneratorCreator( generatorCreator( idMemberDetails, generatorAnnotation ) );\n\t\t\tthrow new AnnotationException( String.format(\n\t\t\t\t\tLocale.ROOT,\n\t\t\t\t\t\"Identifier attribute '%s' is annotated '%s' which is not an '@IdGeneratorType'\",\n\t\t\t\t\tgetPath( propertyHolder, inferredData ),\n\t\t\t\t\tgeneratorAnnotations.get(0).annotationType().getName()\n\t\t\t) );\n\t\t}\n\t\telse if ( idMemberDetails.hasDirectAnnotationUsage( GeneratedValue.class ) ) {\n\t\t\tcreateIdGenerator( idMemberDetails, idValue, propertyHolder.getPersistentClass(), buildingContext );\n\t\t}\n\t}\n\n\t/**\n\t * Returns the value generation strategy for the given property, if any, by\n\t * considering {@linkplain ValueGenerationType generator type annotations}.\n\t */\n\tstatic GeneratorCreator createValueGeneratorFromAnnotations(\n\t\t\tPropertyHolder holder, String propertyName,\n\t\t\tValue value, MemberDetails property, MetadataBuildingContext buildingContext) {","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java#L844-L880","documentation":"Error \"Identifier attribute '%s' is annotated '%s' which is not an '@IdGeneratorType'\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An identifier/value generator declaration is inconsistent with the referenced generator or the annotated element.","commonSituations":"@GeneratedValue pointing at a generator of the wrong kind (SEQUENCE vs TABLE), a missing named generator, too many generator annotations, or an unsupported generation strategy for @CollectionId.","solutions":["Replace the annotation with one meta-annotated with @IdGeneratorType, or remove it."],"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"}