blaze-persistence
blaze-persistence copied to clipboard
Selecting a model subset (via fetches) leads to NPE when @EntityViewInheritance is involved
I don't have a simple reproducer for this but the situation is roughly following:
- EV A contains (possibly deeply nested) a collection of EV B which has
@EntityViewInheritance
defined - I create an
EntityViewSetting
withfetches
which don't contain the Bs collection - I apply the setting to the CB and fetch
resultList
Expected: The query executes ok.
Actual: NPE in https://github.com/Blazebit/blaze-persistence/blob/08793f4ab72cd57762bb6d222ad1fa9421f23e22/entity-view/impl/src/main/java/com/blazebit/persistence/view/impl/objectbuilder/transformator/TupleTransformatorFactory.java#L135
Details: The classMappingIndex
not present in the tuple
corresponds to a "class type" select expression related to the Bs collection. That's why I think it's related to @EntityViewInheritance
Update: There's a crude fix/workaround https://github.com/Blazebit/blaze-persistence/pull/1723