Issues

Select view

Select search mode

 

Envers fails to initialize Map with Embeddables (Could not resolve attribute 'REVTYPE' of 'java.util.Map')

Description

There is a problem when an entity with a Map containing @Embeddable values is loaded from Envers.

The problem occurs when a UserAddress entity is loaded via Envers:

The following Exception is thrown:

IllegalArgument org.hibernate.query.sqm.UnknownPathException: Could not resolve attribute 'REVTYPE' of 'java.util.Map' [select new list(ee__, e__) from UserAddress_entries_AUD ee__, datamodel.User_AUD e__ where ee__.originalId.mapkey_id = e__.originalId.id and ee__.originalId.UserAddress_id = :UserAddress_id and e__.originalId.REV.id = (select max(e2__.originalId.REV.id) from datamodel.User_AUD e2__ where e2__.originalId.REV.id <= :revision and e__.originalId.id = e2__.originalId.id) and ee__.originalId.REV.id = (select max(ee2__.originalId.REV.id) from UserAddress_entries_AUD ee2__ where ee2__.originalId.REV.id <= :revision and ee__.originalId.UserAddress_id = ee2__.originalId.UserAddress_id and ee__.street is not distinct from ee2__.street and ee__.originalId.mapkey_id = ee2__.originalId.mapkey_id) and ee__.originalId.REVTYPE != :delrevisiontype and e__.originalId.REVTYPE != :delrevisiontype]

A full reproducer is attached.

Attachments

1

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Created October 29, 2024 at 1:04 PM
Updated November 14, 2024 at 8:18 AM

Activity

Show:

stringintech November 5, 2024 at 9:38 PM
Edited

Apparently, the issue was first reported in and fixed, but that fix was reverted because it caused a new issue ( ). A proper fix was planned in , but it hasn’t been done yet.
Also see EntityMapCompositeElementTest.

Loading...