I'm wondering if we could collect the unqualified roles in the parseContext if the class is a MappedSuperClass and add them to the collectionRoles when we find the first @Entity in the way and qualify them with this entity?
Possible, yes. I guess that would be one way of doing it. So far we did not have to care about the type of mapped classes etc. All we cared about when it came to JPA/Hibernate annotations was @Id.
The easy way to fix this would have been to tweak TypeMetadata.isSubRole to ignore the class name
Right. I think that might be the way to go. As you say, I think the class name part of the of the collection event role name is not really important for us. I don't think that for our case it is so important that we cannot "cleanly" un-qualify the path. It should be enough to just match the known role name via a regular expression. This will break if ORM introduces different separators in the role name, but in this case it also becomes easier and more accurate to do the comparison.
|