{"record":{"id":"e0c627bd7f43d02f","repo":"hibernate/hibernate-orm","slug":"changelog-has-multiple-members-annotated-wit","errorCode":null,"errorMessage":"@Changelog '{}' has multiple members annotated with @{}","messagePattern":"@Changelog '(.+?)' has multiple members annotated with @(.+?)","errorType":"exception","errorClass":"MappingException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/model/internal/AuditHelper.java","lineNumber":516,"sourceCode":"\t\tfinal String revNumberName = revNumberMember.resolveAttributeName();\n\t\tfinal String revTimestampName = revTimestampMember.resolveAttributeName();\n\t\tcontext.getMetadataCollector().addSecondPass( (OptionalDeterminationSecondPass) ignored ->\n\t\t\t\tvalidateChangelog( entityName, revNumberName, revTimestampName, context )\n\t\t);\n\t}\n\n\t/**\n\t * Check if a member has the given annotation. If found, validate no\n\t * duplicate and return the member; otherwise return the existing value.\n\t */\n\tprivate static MemberDetails checkAnnotation(\n\t\t\tMemberDetails member,\n\t\t\t@Nullable MemberDetails existing,\n\t\t\tClass<? extends Annotation> annotationType,\n\t\t\tClassDetails classDetails) {\n\t\tif ( member.hasDirectAnnotationUsage( annotationType ) ) {\n\t\t\tif ( existing != null ) {\n\t\t\t\tthrow new MappingException(\n\t\t\t\t\t\t\"@Changelog '\" + classDetails.getName()\n\t\t\t\t\t\t\t\t+ \"' has multiple members annotated with @\"\n\t\t\t\t\t\t\t\t+ annotationType.getSimpleName()\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn member;\n\t\t}\n\t\treturn existing;\n\t}\n\n\t/**\n\t * Second-pass validation: verify {@code @Changelog.ChangesetId}\n\t * and {@code @Changelog.Timestamp} are mapped as basic properties,\n\t * and add a unique constraint on non-ID {@code @ChangesetId}.\n\t */\n\tprivate static void validateChangelog(\n\t\t\tString entityName,\n\t\t\tString revNumberName,","sourceCodeStart":498,"sourceCodeEnd":534,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AuditHelper.java#L498-L534","documentation":"Error \"@Changelog '{}' has multiple members annotated with @{}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An Envers-style @Changelog member mapping is invalid (multiple annotated members, unmapped member, or non-basic attribute).","commonSituations":"Audited entities where the changelog class has more than one tracked member, references a property that is not mapped, or tracks a non-basic (association/embeddable) attribute.","solutions":["Remove the duplicate @Changelog-annotated members so that only one member of the class carries the annotation.","If multiple members need change tracking, combine them into a single annotated member or wrapper."],"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"}