HHH-12332 - Test and fix for unrelated same named singular attributes in subtypes
This commit is contained in:
parent
f2d77a033e
commit
a9a26087bb
|
@ -250,6 +250,10 @@ public abstract class AbstractPropertyMapping implements PropertyMapping {
|
|||
PersistentClass otherClass = metadata.getEntityBinding( entityType2.getAssociatedEntityName() );
|
||||
PersistentClass commonClass = getCommonPersistentClass( thisClass, otherClass );
|
||||
|
||||
if ( commonClass == null ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Create a copy of the type but with the common class
|
||||
if ( entityType1 instanceof ManyToOneType ) {
|
||||
ManyToOneType t = (ManyToOneType) entityType1;
|
||||
|
|
|
@ -104,12 +104,16 @@ public class JoinedInheritanceTest extends BaseCoreFunctionalTestCase {
|
|||
public static class EntityA extends BaseEntity {
|
||||
@OneToMany(fetch = FetchType.LAZY)
|
||||
private Set<EntityC> attributes;
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
private EntityC relation;
|
||||
}
|
||||
|
||||
@Entity(name = "EntityB")
|
||||
public static class EntityB extends BaseEntity {
|
||||
@OneToMany(fetch = FetchType.LAZY)
|
||||
private Set<EntityD> attributes;
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
private EntityD relation;
|
||||
}
|
||||
|
||||
@Entity(name = "EntityC")
|
||||
|
|
Loading…
Reference in New Issue