@JoinColumn with referencedColumnName on a @SecondaryTable

I’m trying to figure out how to do a @ManyToOne mapping with the join column being part of a secondary table of the target entity.

@Entity
@Table(name = "being")
@Inheritance
@DiscriminatorColumn(name = "type")
abstract class Being {
    // some unimportant fields
}

@Entity
@SecondaryTable(name = "animal")
abstract class Animal extends Being {
    @Column(name = "uuid", table = "animal")
    private String uuid;
}

@Entity
@SecondaryTable(name = "cat")
@DiscriminatorValue(value = "CAT")
class Cat extends Animal {
    @Column(name = "name", table = "cat")
    private String name;
}

@Entity
class Toy {
    // @Column(name = "animal_uuid")
    // private String animalUuid; 

    // what mapping can I use here? The following does't work.
    @ManyToOne
    @JoinColumn(name = "animal_uuid", referencedColumnName = "uuid")
    private Cat cat;
}

With this I get an error similar to: Unable to find column with logical name: uuid in org.hibernate.mapping.Table(being) and its related supertables and secondary tables

Looks like a bug, but then JPA also doesn’t provide a way to specify the table of the referencedColumn in a @JoinColumn. I’d say you should create a bug report for this with a reproducer: https://hibernate.atlassian.net

Thanks for the response. I created [HHH-15111] - Hibernate JIRA