hibernate/hibernate-orm · error · IllegalArgumentException
CollectionPersister does not implement…
Error message
CollectionPersister does not implement CollectionMutationTarget
What it means
Internal cast guard resolveMutationTarget: the given CollectionPersister is not an AbstractCollectionPersister implementing CollectionMutationTarget, yet collection mutation code requires a mutation target to operate on. This signals a custom or non-standard persister plugged into a code path that only supports the standard implementation; the faulty input is the persister object passed in.
Solutions
- Use a CollectionPersister implementation that implements CollectionMutationTarget (e.g. the standard persisters).
- Upgrade the custom collection persister to implement CollectionMutationTarget.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: A runtime precondition of the Hibernate API is violated.
Common situations: Occurs when application code or configuration does not satisfy the documented contract of the API being called.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/dada097288420d58.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/persister/state/internal/AbstractStateManagement.java:215
}
}
protected static boolean isInsertAllowed(CollectionPersister persister) {
return !persister.isInverse() && persister.isRowInsertEnabled();
}
protected boolean isTablePerSubclass(CollectionPersister persister) {
final var elementPersister = persister.getElementPersister();
return elementPersister != null
&& elementPersister.hasSubclasses()
&& elementPersister instanceof UnionSubclassEntityPersister;
}
protected static AbstractCollectionPersister resolveMutationTarget(CollectionPersister persister) {
if ( persister instanceof AbstractCollectionPersister collectionMutationTarget ) {
return collectionMutationTarget;
}
throw new IllegalArgumentException( "CollectionPersister does not implement CollectionMutationTarget" );
}
@Override
public AuxiliaryMapping createAuxiliaryMapping(
EntityPersister persister,
RootClass bootDescriptor,
MappingModelCreationProcess creationProcess) {
return null;
}
@Override
public AuxiliaryMapping createAuxiliaryMapping(
PluralAttributeMapping pluralAttributeMapping,
Collection bootDescriptor,
MappingModelCreationProcess creationProcess) {
return null;
}View on GitHub (pinned to fad1729dce)