mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-12 14:14:49 +00:00
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 @@ private Type getCommonType(MetadataImplementor metadata, EntityType entityType1,
|
||||
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 static class BaseEntity {
|
||||
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…
x
Reference in New Issue
Block a user