We're updating the issue view to help you get more done. 

ClassCastException for an audited ordered collection

Description

After updating Hibernate and Envers from version 4.3.11 to 5.3.6 the application fails to start due to a ClassCastException: org.hibernate.mapping.Bag cannot be cast to org.hibernate.mapping.IndexedCollection

After some debugging I found out that this happens on an entity with a @OneToMany collection which is ordered using @OrderBy.

1 2 3 4 5 6 7 @OneToMany(mappedBy = "topic", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.EAGER) @OrderBy(value = "mag_index") @AuditMappedBy(mappedBy = "topic", positionMappedBy = "magIndex") @Fetch(FetchMode.SELECT) @BatchSize(size = 100) @Setter private List<InterviewTemplateItem> items = new ArrayList<>();

Environment

None

Status

Assignee

Chris Cranford

Reporter

Christian Plätzinger

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.11
5.2.11

Components

Affects versions

5.3.6

Priority

Major