hibernate/hibernate-orm · error · MappingException
@Changelog '{}' has multiple members annotated with @{}
Error message
@Changelog '{}' has multiple members annotated with @{} What it means
Error "@Changelog '{}' has multiple members annotated with @{}" thrown in hibernate/hibernate-orm.
Source
Thrown at hibernate-core/src/main/java/org/hibernate/boot/model/internal/AuditHelper.java:516
final String revNumberName = revNumberMember.resolveAttributeName();
final String revTimestampName = revTimestampMember.resolveAttributeName();
context.getMetadataCollector().addSecondPass( (OptionalDeterminationSecondPass) ignored ->
validateChangelog( entityName, revNumberName, revTimestampName, context )
);
}
/**
* Check if a member has the given annotation. If found, validate no
* duplicate and return the member; otherwise return the existing value.
*/
private static MemberDetails checkAnnotation(
MemberDetails member,
@Nullable MemberDetails existing,
Class<? extends Annotation> annotationType,
ClassDetails classDetails) {
if ( member.hasDirectAnnotationUsage( annotationType ) ) {
if ( existing != null ) {
throw new MappingException(
"@Changelog '" + classDetails.getName()
+ "' has multiple members annotated with @"
+ annotationType.getSimpleName()
);
}
return member;
}
return existing;
}
/**
* Second-pass validation: verify {@code @Changelog.ChangesetId}
* and {@code @Changelog.Timestamp} are mapped as basic properties,
* and add a unique constraint on non-ID {@code @ChangesetId}.
*/
private static void validateChangelog(
String entityName,
String revNumberName,View on GitHub (pinned to fad1729dce)
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.
When it happens
Trigger: An Envers-style @Changelog member mapping is invalid (multiple annotated members, unmapped member, or non-basic attribute).
Common situations: 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.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/e0c627bd7f43d02f.
Report an issue: GitHub.