@Any discriminated association fails to be implicitly fetched due to UnsupportedOperationException

Description

I have a class that has this association:

When trying to load this from a query, ala:

… results in an UnsupportedOperationException because the fetchable – a DiscriminatedAssociationAttributeMapping – is not a descendant of any of the options in org.hibernate.query.results.Builders#implicitFetchBuilder

Am I doing something wrong?

Activity

Dave MyronJuly 28, 2022 at 7:33 AM
Edited

This is very odd to me:

HBUtil.getSession().createQuery("from SourceAssetRequirement", SourceAssetRequirement.class).list() works fine…
HBUtil.getSession().createNativeQuery("select * from source_asset_requirements", SourceAssetRequirement.class).list() blows up with the UnsupportedOperationException.

(Unfortunately I can’t use createQuery until 6.1.2 is out with the fix)

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created July 28, 2022 at 1:04 AM
Updated August 3, 2022 at 1:40 PM
Resolved August 2, 2022 at 3:24 PM