hibernate/hibernate-orm · error · UnsupportedMappingException
AttributeContainer [ ] does not support identifiers
Error message
AttributeContainer [${className}] does not support identifiers What it means
Sentinel UnsupportedMappingException from AttributeContainer.InFlightAccess.applyIdAttribute: the domain-type container (e.g. an embeddable or MappedSuperclass) does not accept identifier attributes, which only entity types support.
Solutions
- Use an entity type instead of a mapped superclass/embeddable container when identifier access is needed.
Defensive patterns
Strategy: type-guard
When it happens
Trigger: Thrown when identifier access is requested from an attribute container that is not an identifiable type (e.g. a basic or embeddable container).
Common situations: See trigger scenarios.
AI-assisted analysis of hibernate/hibernate-orm@fad1729dce (2026-08-22).
Data as JSON: /api/errors/713eafc797c0ec7c.
Report an issue: GitHub.
Appendix: source
Thrown at hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/AttributeContainer.java:32
/**
* @author Steve Ebersole
*/
public interface AttributeContainer<J> extends ManagedDomainType<J> {
InFlightAccess<J> getInFlightAccess();
/**
* Used during creation of the type
*/
interface InFlightAccess<J> {
void addAttribute(PersistentAttribute<J,?> attribute);
/**
* Callback used when we have a singular id attribute of some form - either a simple id
* or an aggregated composite id ({@link jakarta.persistence.EmbeddedId})
*/
default void applyIdAttribute(SingularPersistentAttribute<J, ?> idAttribute) {
throw new UnsupportedMappingException(
"AttributeContainer [" + getClass().getName() + "] does not support identifiers"
);
}
default void applyNonAggregatedIdAttributes(
Set<? extends SingularPersistentAttribute<? super J, ?>> idAttributes,
EmbeddableDomainType<?> idClassType) {
throw new UnsupportedMappingException(
"AttributeContainer [" + getClass().getName() + "] does not support identifiers"
);
}
/**
* todo (6.0) : we still need to implement this properly and the contract may change
* - specifically I am not certain we will be able to re-use `SingularPersistentAttribute`
* because of its dependence on declaring-type, etc that we may not be able to do
*/
default void applyIdClassAttributes(Set<SingularPersistentAttribute<? super J, ?>> idClassAttributes) {View on GitHub (pinned to fad1729dce)