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

Multiple @MappedSuperClass broke from a 4.3 to 5.2 upgrade

Description

it looks like there might be an issue with building the mappedSuperclassByMappedSuperclassMapping map in MetadataContext.java

Everything was working like a champ in 4.3.10, I decided to upgrade to get JDK8 Date stuff.

In my code I have bunch of entities that extend by AbstractAppObject. and when AttributeFActory.getDeclarerEntityMetamodel is called for the first time I have my DiscussionMessage entity in the (MetadataContext) mappedSuperclassByMappedSuperclassMapping 3 times. this causes virtualIdentifierMemberResolver to find the wrong entity at some point. I end up with a "expecting IdClass mapping" IllegalArgumentException.

If remove my DiscussionMessage entity then I end up with the 'next' entity that has the same chain of abstract classes.

some of my code -

1 2 3 4 5 6 7 8 9 10 @Entity(name="discussion_message") public class DiscussionMessage extends AbstractAppObject { @Audited(auditParents={ AbstractLazyAuditable.class, AbstractPersistable.class }) @EntityListeners(AuditingEntityListener.class) @MappedSuperclass public abstract class AbstractAppObject extends AbstractLazyAuditable<User, Long> implements AppObject { @MappedSuperclass public abstract class AbstractLazyAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements Auditable<U, PK> {

from spring -

1 2 @MappedSuperclass public abstract class AbstractPersistable<PK extends Serializable> implements Persistable<PK> {

Environment

MySql, Spring JPA 1.11.3

Status

Assignee

Unassigned

Reporter

denoc

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.3.10

Affects versions

5.2.7
5.2.11

Priority

Critical