{"record":{"id":"5ed82cf5923dbbf3","repo":"hibernate/hibernate-orm","slug":"property-property-is-annotated-version-but-5ed82c","errorCode":null,"errorMessage":"Property '${property}' is annotated '@Version' but has a 'Generator' which does not generate on updates","messagePattern":"Property '(.+?)' is annotated '@Version' but has a 'Generator' which does not generate on updates","errorType":"exception","errorClass":"AnnotationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java","lineNumber":638,"sourceCode":"\n\tprivate static <A extends Annotation> void callInitialize(\n\t\t\tA annotation,\n\t\t\tGeneratorCreationContext creationContext,\n\t\t\tGenerator generator) {\n\t\tif ( generator instanceof AnnotationBasedGenerator<?> annotationBasedGenerator ) {\n\t\t\tinitializeGenerator( annotationBasedGenerator, annotation, creationContext );\n\t\t}\n\t}\n\n\tprivate static void checkVersionGenerationAlways(MemberDetails property, Generator generator) {\n\t\tif ( isVersion( property ) ) {\n\t\t\tif ( !generator.generatesOnInsert() ) {\n\t\t\t\tthrow new AnnotationException(\"Property '\" + property.getName()\n\t\t\t\t\t\t+ \"' is annotated '@Version' but has a 'Generator' which does not generate on inserts\"\n\t\t\t\t);\n\t\t\t}\n\t\t\tif ( !generator.generatesOnUpdate() ) {\n\t\t\t\tthrow new AnnotationException(\"Property '\" + property.getName()\n\t\t\t\t\t\t+ \"' is annotated '@Version' but has a 'Generator' which does not generate on updates\"\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If the given {@link Generator} also implements {@link Configurable},\n\t * call its {@link Configurable#configure(GeneratorCreationContext, Properties)\n\t * configure()} method.\n\t */\n\tprivate static void callConfigure(\n\t\t\tGeneratorCreationContext creationContext,\n\t\t\tGenerator generator,\n\t\t\tMap<String, Object> configuration,\n\t\t\tValue value) {\n\t\tif ( generator instanceof Configurable configurable ) {\n\t\t\tfinal var parameters = collectParameters(","sourceCodeStart":620,"sourceCodeEnd":656,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/GeneratorBinder.java#L620-L656","documentation":"Error \"Property '${property}' is annotated '@Version' but has a 'Generator' which does not generate on updates\" 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":["Use a generator that generates on updates for the @Version property, or remove the generator."],"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"}