{"record":{"id":"adfe6f50ef94a499","repo":"hibernate/hibernate-orm","slug":"property-property-has-too-many-generator-anno","errorCode":null,"errorMessage":"Property '${property}' has too many generator annotations: ${generatorAnnotations}","messagePattern":"Property '(.+?)' has too many generator annotations: (.+?)","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java","lineNumber":887,"sourceCode":"\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) {\n\t\tfinal var generatorAnnotations =\n\t\t\t\tproperty.getMetaAnnotated( ValueGenerationType.class,\n\t\t\t\t\t\tbuildingContext.getBootstrapContext().getModelsContext() );\n\t\treturn switch ( generatorAnnotations.size() ) {\n\t\t\tcase 0 -> null;\n\t\t\tcase 1 -> generatorCreator( property, value, generatorAnnotations.get(0), beanContainer( buildingContext ) );\n\t\t\tdefault -> throw new AnnotationException( \"Property '\" + qualify( holder.getPath(), propertyName )\n\t\t\t\t\t+ \"' has too many generator annotations: \" + generatorAnnotations );\n\t\t};\n\t}\n\n\tpublic static void applyIfNotEmpty(String name, String value, BiConsumer<String,String> consumer) {\n\t\tif ( isNotEmpty( value ) ) {\n\t\t\tconsumer.accept( name, value );\n\t\t}\n\t}\n\n\tprivate static Setter injector(Property property, Class<?> attributeDeclarer) {\n\t\treturn property.getPropertyAccessStrategy( attributeDeclarer )\n\t\t\t\t.buildPropertyAccess( attributeDeclarer, property.getName(), true )\n\t\t\t\t.getSetter();\n\t}\n\n\t/**\n\t * Return the class that declares the composite pk attributes,","sourceCodeStart":869,"sourceCodeEnd":905,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java#L869-L905","documentation":"Error \"Property '${property}' has too many generator annotations: ${generatorAnnotations}\" 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":["Keep only one generator annotation on the property."],"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"}