-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Right now when non-entity, i.e. a class that lacks the @entity annotation, is referenced in a collection, the MappingExtractor will crash with a confusing exception:
org.om.core.api.exception.MappingException: Target type interface java.util.List is not an entity. (in com.foo.type.that.ReferencesTheNonEntity)
at org.om.core.impl.mapping.extractor.FieldMappingExtractorImpl.extract(FieldMappingExtractorImpl.java:88)
at org.om.core.impl.mapping.extractor.EntityMappingExtractorImpl.extractFields(EntityMappingExtractorImpl.java:66)
at org.om.core.impl.mapping.extractor.EntityMappingExtractorImpl.extract(EntityMappingExtractorImpl.java:43)
at org.om.core.impl.mapping.registry.OnDemandMappingRegistry.getMapping(OnDemandMappingRegistry.java:25)
at org.om.core.impl.session.ImmutableSessionImpl.get(ImmutableSessionImpl.java:56)
To reproduce:
Type A has a collection mapping
@Entity
class A {
@Collection(targetType=B.class)
private List<B> bs;
}
However, B is not an entity:
class B { }
The error message should be more clear on what happens and provide guidance how to resolve the situation.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels